Skip to content

Small script to crate schema and tables from sql script and json info. Populates fields from json file. It dumps tables in json file.

License

Notifications You must be signed in to change notification settings

guve4e/db-populator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DB populator

###Directory structure

alt-text-1

  • dumps - contains tables dumped in json files
  • schema - contains slq script to create tables and json config to connect to MySQL
  • src - contains source code
  • unit_test - contains unit tests
  • venv - libraries
  • wiki - documentation
.
├── dumps
│   ├── EXAMPLE1.json
│   ├── EXAMPLE2.josn
│── schema
│   ├── tables.json
│   ├── schema_info.json
│── src.js
│   └── parse.json
│   │── sql.py
│── unit_test
│── venv
└── wiki

How to use?

  • Create table script and save it schema/tables.sql
  • Fill database connection configuration in schema/schema_info.json
  • Fill json files corresponding to the sample.json to represent an sql table
  • Executing ./populate.py will read the json files and populate tables in db
  • Executing ./dump.py will read the tables and populate json files in "dumps"

About

Small script to crate schema and tables from sql script and json info. Populates fields from json file. It dumps tables in json file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published