A tools to perform different actions over the MySql. You can fresh/truncate your database safely using very simple command or you can import the api to your project. It has on the fly sql running capabilites.
If you want to run as a cli global then
npm install -g run-my-sql
Or as project dependency
npm install -S run-my-sql
Command line usage
runMySql <file> [options]
i.e
runMySql --fresh --seedFile ./schema.sql --user=root --password=root --database=my_db
Api level usage
const {runMySql} = require('../index');
runMySql({
type: 'fresh',
options: {
seedFile: `${__dirname}/../data/dump.sql`
}
}).then((res) => {
console.log(res);
}).catch((err) => {
console.log(err);
});
--host [optional] The hostname of the database you are connecting to. --port [optional] The port number to connect to. --user The MySQL user to authenticate as. --password The password of that MySQL user.
-V, --version output the version number -h, --help output usage information