@tibormarias/quickgrate

3.0.1 • Public • Published

Quickgrate

A fast and easy way to copy and seed one MySQL database to another

What does it do?

Quickgrate copies table stuctures and table contents from a master database to a slave database. I use it in order to have production data in my dev environments for real world testing purposes. Be careful, it deletes existing tables on slave!

Installation

Install the package

npm install @tibormarias/quickgrate --save-dev

Create a file named quickgrate.config.js in your project's root directory with the following structure

export default {
    master: {
        host: "127.0.0.1",
        port: "3306",
        user: "user",
        password: "pass",
        database: "production",
    },
    slave: {
        host: "127.0.0.1",
        port: "3306",
        user: "user",
        password: "pass",
        database: "development"
    },
    rows_limit: 25000,
    tables: {
        do_not_create: [],
        do_not_seed: []
    }
}

Running the script

npx quickgrate

Optional flags

--changes only remove and seed tables that are different on slave then on master

Development

Want to contribute? I am grateful for any contribution, feel free to code it or message me!

Readme

Keywords

none

Package Sidebar

Install

npm i @tibormarias/quickgrate

Weekly Downloads

1

Version

3.0.1

License

ISC

Unpacked Size

6.48 kB

Total Files

5

Last publish

Collaborators

  • tibormarias