0.2.6 • Published 4 years ago

sql-auto-egg v0.2.6

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

sequelize-auto-egg

基于sequelize-auto,生成数据库模型字符串。

use

const SequelizeAutoEgg = require("sql-auto-egg").default;
const auto = new SequelizeAutoEgg(
  'dbName',
  'user',
  'password',
  {
    host: 'host',
    dialect: "mysql",
    port: 'port',
    tables: ['table'],
    camelCase: true,
  }
);
auto.run(function (err) {
  console.log(auto.eggModel)
}

get

`{
  id: {
    autoIncrement: true,
    type: DataTypes.BIGINT,
    allowNull: false,
    primaryKey: true
  },
  courseId: {
    type: DataTypes.BIGINT,
    allowNull: true,
    comment: '课程Id',
    field: 'course_id'
  },
  courseName: {
    type: DataTypes.STRING(64),
    allowNull: true,
    comment: '课程名称',
    field: 'course_name'
  },
  orderId: {
    type: DataTypes.BIGINT,
    allowNull: true,
    comment: '订单Id',
    unique: true,
    field: 'order_id'
  },
  payTime: {
    type: DataTypes.BIGINT,
    allowNull: true,
    comment: '支付时间',
    field: 'pay_time'
  },
  payAmount: {
    type: DataTypes.DECIMAL,
    allowNull: true,
    defaultValue: 0.00,
    comment: '支付金额',
    field: 'pay_amount'
  }
}`
0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.1.2

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.5

4 years ago

0.1.0

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago