json-schema2sequelize

0.0.2 • Public • Published

json-schema2sequelize

Just a simple JSON to Sequelize code generator, because I needed it. Not many syntax options, but I expect that to change over time.

Usage

const converter = require('json-schema2sequelize');
converter.toSequelize('tableName', jsonSchema, {});
//returns an array of create statements
converter.toSequelizeUpdates('tableName', newJSONSchema, oldJSONSchema, {});
//returns two arrays of SQL statements in an object as `ups` and `downs
converter.toSequelizeInsert('tableName', jsonObject, {});
//returns a single insert statement from the object(s) provided

Testing

mocha

Readme

Keywords

none

Package Sidebar

Install

npm i json-schema2sequelize

Weekly Downloads

13

Version

0.0.2

License

none

Unpacked Size

8.77 kB

Total Files

5

Last publish

Collaborators

  • khrome