0.0.10 • Published 7 years ago

sql-createtableobject v0.0.10

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

sql-createtableobject

NPM

Returns SQL Query of Create Table using an Object.

var createtable = require('sql-createtableobject');
// createtable(<table>, <column types>, <keys>);

createtable('speech', {'person': 'text', 'speech': 'text'}, ['person']);
// {"query": "CREATE TABLE IF NOT EXISTS "speech" ("person" text,"speech" text,PRIMARY KEY("person"));"}

createtable('speech', {'person': 'text', 'speech': 'text'}, 'person');
// {"query": "CREATE TABLE IF NOT EXISTS "speech" ("person" text,"speech" text,PRIMARY KEY("person"));"}

createtable('speech', {'person': 'text primary key', 'speech': 'text'});
// {"query": "CREATE TABLE IF NOT EXISTS "speech" ("person" text primary key,"speech" text);"}
0.0.10

7 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago