Thanks to visit codestin.com
Credit goes to github.com

Skip to content

abshamrat/run-my-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

run-my-sql

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.

Installation

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

Usage

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);
});

Options

--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

About

A tools to perform different actions over the MySql

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published