
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
egg-sequelize-mg
Advanced tools
This package allows the user to automatically generate the required sequelize model file based on the database configuration, based on sequelize-mg and egg-sequelize was adapted.
npm i egg-sequelize-mg --save-dev
// {appRoot}/config/database/sequelize.js
'use strict';
module.exports = {
datasources: [{
delegate: 'maindb',
baseDir: 'model/main',
database: 'main',
dialect: 'mysql',
username: 'root',
password: 'root',
define: {
timestamps: false,
freezeTableName: true,
underscored: true,
},
}, {
delegate: 'testdb',
baseDir: 'model/test',
database: 'test',
dialect: 'mysql',
username: 'root',
password: 'root',
define: {
timestamps: false,
freezeTableName: true,
underscored: true,
},
}],
};
// {appRoot}/tools/model-generator.js
'use strict';
const path = require('path');
const generator = require('egg-sequelize-mg');
const config = require('../config/database/sequelize');
const tables = {
testdb: [ 'table1', 'table2' ], // If you don't want to generate all the tables in the database, configure the whitelist here.
}
// Output files to the target directory using a simple format
generator.generate(config, tables, path.join(__dirname, '../app/'), { mysql: generator.readMysql });
If you want to see more examples, please see here. If you want to configure your own file format, please go to sequelize-mg
npm run test
985ch
Copyright © 2019 985ch.
This project is MIT licensed.
This README was translate by google
FAQs
A customizable sequelize model generation tool for egg-sequelize
We found that egg-sequelize-mg demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.