json2mysql
[![Code Style][standard-image][standard-url]]
A tool to remove all records in one Mysql table and load from a JSON/JS object file.
note It will disable foreign key check when remove data, an enable after loading finish.
Install
npm i json2mysql
Usage
import json2mysql from "json2mysql"
json2mysql()
Test
docker-compose up -d
will create database container- create a test table in your database
CREATE TABLE `user` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
`name` text,
`team_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
npm test
License
MIT © [chopperlee]