quick-migrate-lib
v1.2.0
Published
Lib to auto migrate your project
Downloads
28
Readme
quick-migrate-lib
Lib that migrates auto the code.
use
import the migrate() and run it, with the sqlFIle path and connection Params:
////migration.ts
import migrate from 'quick-migrate-lib'
const connectionParams = {
host: process.env.DB_HOST,
port: Number(process.env.DB_PORT),
user: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
multipleStatements: true,
}
const sqlFile = './src/Infra/reader_dungeon.sql'
migrate(sqlFile, connectionParams);
to execute this method in npm, goto package.json scripts and install tsx;
npm i --save-dev tsx;
tsx src/migrate.ts