Neutral Political Machine

    sequelize-models-generator

    0.0.1 • Public • Published

    sequelize-models-generator

    Util for generate sequelize models from pure MySQL tables.

    Install

    $ npm i sequelize-models-generator

    Tests

    $ npm test

    Usage

    const generateModels = require('sequelize-models-generator')
     
    const { Users } = await generateModels({
      host: process.env.DB_HOST,
      db: process.env.DB_NAME,
      user: process.env.DB_USER,
      password: process.env.DB_PASSWORD
    }, [
      {
        tableName: 'game_users', // table name in db
        newTableName: 'Users'    // table name which return
      }
    ])
     
    // call any sequelize methods as usually
     
    // e.g.
    await Users.create({})
    await Users.findOne({})
    await Users.findAll({})

    Install

    npm i sequelize-models-generator

    DownloadsWeekly Downloads

    8

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    6.06 kB

    Total Files

    7

    Last publish

    Collaborators

    • bifot