{"id":16979394,"url":"https://github.com/eduardo-matos/sequelauto","last_synced_at":"2026-04-12T20:54:16.376Z","repository":{"id":143326818,"uuid":"108455311","full_name":"eduardo-matos/sequelauto","owner":"eduardo-matos","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-04T02:55:46.000Z","size":36,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-26T12:21:04.355Z","etag":null,"topics":["database","fixtures","node","sequelize","tdd"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eduardo-matos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-26T19:17:31.000Z","updated_at":"2019-10-04T21:12:28.000Z","dependencies_parsed_at":"2023-04-22T14:17:22.938Z","dependency_job_id":null,"html_url":"https://github.com/eduardo-matos/sequelauto","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eduardo-matos%2Fsequelauto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eduardo-matos%2Fsequelauto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eduardo-matos%2Fsequelauto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eduardo-matos%2Fsequelauto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eduardo-matos","download_url":"https://codeload.github.com/eduardo-matos/sequelauto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244880657,"owners_count":20525515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","fixtures","node","sequelize","tdd"],"created_at":"2024-10-14T01:45:40.633Z","updated_at":"2026-04-12T20:54:11.295Z","avatar_url":"https://github.com/eduardo-matos.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sequelauto\n\n[![Build Status](https://travis-ci.org/eduardo-matos/sequelauto.svg?branch=master)](https://travis-ci.org/eduardo-matos/sequelauto)\n[![npm version](https://badge.fury.io/js/sequelauto.svg)](https://badge.fury.io/js/sequelauto)\n[![Coverage Status](https://coveralls.io/repos/github/eduardo-matos/sequelauto/badge.svg?branch=master)](https://coveralls.io/github/eduardo-matos/sequelauto?branch=master)\n\nAutomatically generate records on database for Sequelize's model.\n\n## Usage\n\nLet's say you have the following model:\n\n```js\nconst Sequelize = require('sequelize');\n\nconst sequelize = new Sequelize('sqlite://');\n\nmodule.exports = User = sequelize.define('user', {\n  name: {\n    type: Sequelize.STRING(100),\n    allowNull: false\n  },\n  birth: Sequelize.DATE,\n  height: {\n    type: Sequelize.DECIMAL,\n    allowNull: false\n  }\n});\n```\n\nIt would be a pain in the ass to create dummy entries on the database manually.\nThat's when sequelauto comes in handy:\n\n```js\nconst User = require('./models');\nconst sequelauto = require('sequelauto');\n\nsequelauto.create(User).then(user =\u003e {\n  // \"user\" is a sequelize model instance!\n  console.log(user.dataValues); // {id: 1, name: \"bjda2sghat\", \"birth\": null, \"height\": 1.3}\n});\n```\n\nYou can also create many instances at once:\n\n```js\nsequelauto.createMany(User, 10).then(users =\u003e {\n  // \"users\" is an array of all created users\n  console.log(users.map(u =\u003e u.dataValues)); // [{id: 1, name: \"bjda2sghat\", \"birth\": null, \"height\": 1.3}, ...]\n});\n```\n\nThere is also a possibility to define your own values:\n\n```js\nsequelauto.create(User, { name: 'John Doe', height: 5.8 }).then(user =\u003e {\n  console.log(user.dataValues); // [{id: 1, name: \"John Doe\", \"height\": 5.8, \"birth\": null}, ...]\n});\n```\n\nBy default nullable fields remain null.\n\n## Supported field types\n\n1. `STRING`\n1. `CHAR`\n1. `TEXT`\n1. `TINYINT`\n1. `SMALLINT`\n1. `MEDIUMINT`\n1. `INTEGER`\n1. `BIGINT`\n1. `FLOAT`\n1. `DOUBLE`\n1. `DECIMAL`\n1. `REAL`\n1. `BOOLEAN`\n1. `ENUM`\n1. `DATE`\n1. `DATEONLY`\n1. `TIME`\n1. `UUID`\n1. `JSON`\n1. `JSONB`\n1. `BLOB`\n\nIn order to avoid mistakes, by default it runs only on SQLite.  \nHere is how to disable this feature:\n\n```js\nconst sequelauto = require('sequelauto');\n\nsequelauto.configure('RUN_ONLY_ON_SQLITE', false);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feduardo-matos%2Fsequelauto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feduardo-matos%2Fsequelauto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feduardo-matos%2Fsequelauto/lists"}