nomemory / neat-sample-databases-generators

Neat java scripts (!not javascript) to generate arbitrary data for various sample databases (hr schema, classicmodels, etc.)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A list of scripts that are genering DDL and DML scripts to fill-up sample schemas with data.

Scripts are written in Java, and can be run using jbang.

To install jbang - check the official documentation - or simply:

curl -s "https://get.sdkman.io" | bash 
source ~/.bash_profile
sdk install java 
sdk install jbang

Data is generated using mockneat.

Contributions are welcomed!

List of scripts

Script Schema Targets
scripts/classicmodels_mysql.java classicmodels mysql, mariadb
scripts/classicmodels_postgresql.java classicmodels postgresql
scripts/hr_schema_mysql.java HR mysql, mariadb
scripts/hr_schema_postgresql.java HR postgresql

Running the scripts

After cloning the project:

jbang scripts/hr_schema_mysql.java > inserts.sql

Most scripts support various options (e.g.: generating more data, or target various databases). The best way to see the options a script is offering:

jbang scripts/hr_schema_mysql.java --help

Each subsequent run will generate arbitrary data, different than the previous run.

Supported Schemas

ER diagrams were generated using DBeaver.

HR Schema (SQL)

If you ever had the chance to work with Oracle DB this is probably one of the most known sample schemas to play with.

It models an HR application containing information about the Company's Locations, Departements, Employees and their Managers.

HR Schema

classicmodels (SQL)

This is a classic schema describing a online-shop.

It's one of the official sample schemas for MySQL.

classicmodels

About

Neat java scripts (!not javascript) to generate arbitrary data for various sample databases (hr schema, classicmodels, etc.)


Languages

Language:Java 100.0%