Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json2mysql

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json2mysql - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc