w-auto-sequelize v1.0.27
w-auto-sequelize
A wrapper for sequelize-auto.
Fork from: sequelize-auto
Documentation
To view documentation or get support, visit docs.
Installation
Using npm(ES6 module):
Note:
w-auto-sequelize
is mainly dependent onsequelize
,async
,eslint
,fs
andpath
npm i w-auto-sequelize
Example for generate:
Link: [dev source code]
import was from 'w-auto-sequelize'
//opt let opt = { database: 'worm', username: 'username', password: 'password', dialect: 'mssql', directory: './models', host: 'localhost', port: 1433, }
was(opt) .then((res) => { console.log(JSON.stringify(res, null, 4)) }) .catch((err) => { console.log(err) })
// then => { // "tables": { // "users": { // "id": { // "type": "VARCHAR(50)", // "allowNull": false, // "defaultValue": null, // "primaryKey": true, // "autoIncrement": false, // "comment": null, // "foreignKey": { // "source_table": "users", // "constraint_name": "PK_users", // "source_column": "id", // "target_table": null, // "target_column": null, // "constraint_type": "PRIMARY KEY", // "is_identity": false, // "isPrimaryKey": true // } // }, // "name": { // "type": "NVARCHAR(50)", // "allowNull": true, // "defaultValue": null, // "primaryKey": false, // "autoIncrement": false, // "comment": null // }, // "value": { // "type": "FLOAT", // "allowNull": true, // "defaultValue": null, // "primaryKey": false, // "autoIncrement": false, // "comment": null // } // } // }, // "foreignKeys": { // "users": { // "id": { // "source_table": "users", // "constraint_name": "PK_users", // "source_column": "id", // "target_table": null, // "target_column": null, // "constraint_type": "PRIMARY KEY", // "is_identity": false, // "isPrimaryKey": true // } // } // } // }
1 month ago
1 month ago
2 months ago
2 months ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago