Simple project for generation of mock data on any database structure
You don't need any clarification for your database - simply input your db's credentials and run this CLI utility
- Copy-paste and rename
config_example.json
toconfig.json
. And place your db's credentials - Run
npm install
(in root of project) - Run
node ./ 10
- to generate 10 rows for every table (in root of project) - Import
result_<DATABASE>.sql
(in results folder) to your db. - Done.
- NodeJS version 14+
- Installed dependencies (clarification for python users)
- Knowledge Working terminal (it's CLI utility)
- Install dependencies via
npm install
command in root of project
Copy-paste config_example.json
, name it config.json
.
Provide credentials to desired database
Optional. Edit chances of generation
Simple run node ./
in root of project
This procedure will generate mock-settings.json at the root of the project
where you can adjust the number of rows you want to create with simple data
Edit mock-settings.json
and run again. Or simple provide number of rows for all tables via 3rd argument.
i.g.
node ./ 10
- will generate 10 rows for every table
Check root folder after running CLI
There are 2 files created inside of results folder. result_<DATABASE>.json
with JSON presentation
And result_<DATABASE>.sql
with SQL presentation that you can use for your database
You can edit column-preset.js
in custom folder and name it column-preset-custom.js
for your desired values for any columns.
This project uses faker.js
for generating mock data
Feel free to make pull requests