Skip to content

Creates lines of code to seed a database with random varchars & integers.

Notifications You must be signed in to change notification settings

annarankin/random-SQL-Gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

random-SQL-Gen

Creates lines of code to seed a database with random varchars & integers using node-sqlite3. ##Input: To run the program, type $node datagen.js <TABLENAME> <NUMBER OF LINES TO GENERATE> <header1> <datatype (varchar/integer min max)>, ...

###Example:

$ node datagen.js table2 5 name varchar, age integer 30 40

You asked for 5 line(s) to be generated for table2 containing:
name varchar, age integer 30 40
db.run("INSERT INTO table2 (name, age) VALUES ('rub', 36);");
db.run("INSERT INTO table2 (name, age) VALUES ('fang', 31);");
db.run("INSERT INTO table2 (name, age) VALUES ('tomatoes', 38);");
db.run("INSERT INTO table2 (name, age) VALUES ('talk', 39);");
db.run("INSERT INTO table2 (name, age) VALUES ('language', 37);");
DONE

Program will throw you an error if you format your data incorrectly.

About

Creates lines of code to seed a database with random varchars & integers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published