# sql-auto-egg

> 基于[sequelize-auto](https://github.com/sequelize/sequelize-auto)，生成数据库模型字符串。 ## use ``` const SequelizeAutoEgg = require("sql-auto-egg").default; const auto = new SequelizeAutoEgg( 'dbName', 'user', 'password', { host: 'host', dialect: "mys

Latest version **0.2.6** (published 2020-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install sql-auto-egg
pnpm add sql-auto-egg
yarn add sql-auto-egg
bun add sql-auto-egg
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.6 |
| Published | 2020-09-10 |
| First published | 2020-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 (+7 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jovi |
| Maintainers | jovilin |

## Links

- npm: https://www.npmjs.com/package/sql-auto-egg
- Repository: https://github.com/Linjovi/sequelize-auto-egg
- Homepage: https://github.com/Linjovi/sequelize-auto-egg#readme
- Issues: https://github.com/Linjovi/sequelize-auto-egg/issues
- npm.io page: https://npm.io/package/sql-auto-egg

## Dependencies (3)

- [mysql2](https://npm.io/package/mysql2.md) ^2.1.0
- [sequelize](https://npm.io/package/sequelize.md) ^6.3.5
- [sequelize-auto](https://npm.io/package/sequelize-auto.md) 0.5.3

## Recent versions

- 0.2.6 (latest) — 2020-09-10
- 0.2.5 — 2020-09-10
- 0.2.4 — 2020-09-10
- 0.2.3 — 2020-09-10
- 0.2.2 — 2020-09-10
- 0.2.1 — 2020-09-10
- 0.2.0 — 2020-08-07
- 0.1.5 — 2020-08-07
- 0.1.4 — 2020-08-07
- 0.1.3 — 2020-08-07
- 0.1.2 — 2020-08-07
- 0.1.1 — 2020-08-07
- 0.1.0 — 2020-08-05
- 0.0.4 — 2020-08-05
- 0.0.3 — 2020-08-04
- … 2 more at https://npm.io/package/sql-auto-egg/versions

## README

# sequelize-auto-egg
基于[sequelize-auto](https://github.com/sequelize/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'
  }
}`
```

---
_Source: https://npm.io/package/sql-auto-egg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
