Skip to content

tracktasktime/filldb-pg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

filldb-pg

Automatically generate data and fill your database tables with test data.

filldb-pg will try to guess the format of data required based on column names and will generate random names, dates, emails, addresses and more to fill your PostgreSQL database with data.

Example of usage

const {Pool} = require("pg");
const fillDB = require('./index');

const pool = new Pool();
const usersTable = `CREATE TABLE IF NOT EXISTS
                       users
                   (
                       id         SERIAL PRIMARY KEY,
                       email      VARCHAR      NOT NULL UNIQUE,
                       first_name VARCHAR(128) NOT NULL,
                       last_name  VARCHAR(128) NOT NULL
                   )`;

fillDB.fillFake(pool, usersTable, 5);
pool.end();

As result

id email first_name last_name
1 [email protected] Arvilla Yost
2 [email protected] Willard Kunze
3 [email protected] Guadalupe Dare
4 [email protected] Cynthia Hahn
5 [email protected] Adelia Buckridge

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published