Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "json2mysql", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "A tool for comparing your configure json file with mysql table, then Loaded", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -8,6 +8,4 @@ # json2mysql | ||
A tool to **remove** all records in one Mysql table and load from a JSON/JS object file. | ||
A tool to **load** a JSON/JS object file to Mysql. | ||
**note** It will disable foreign key check when remove data, an enable after loading finish. | ||
## Install | ||
@@ -24,5 +22,13 @@ | ||
json2mysql() // true | ||
const dbconfig = {} | ||
const jm = json2mysql(dbconfig) | ||
jm.load(tableName, file) | ||
jm.replace(tableName, file) | ||
``` | ||
## Methods | ||
- `load`: this will disable foreign key, **remove** table rows , then load json and enable foreign key | ||
- `replace`: this will replace table rows with json file, by comparing table id with array index | ||
## Test | ||
@@ -29,0 +35,0 @@ 1. `docker-compose up -d ` will create database container |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7383
59