createTable(): string
Generate SQL command for CREATE TABLE.
Example 1
Example 1
xsql.createTable("plant", {name: "TEXT", type: "TEXT", age: "INT"}); // → CREATE TABLE IF NOT EXISTS "plant" ("name" TEXT, "type" TEXT, "age" INT); xsql.createTable("animal", {name: "TEXT", type: "TEXT", age: "INT"}, {pk: "name"}); // → CREATE TABLE IF NOT EXISTS "animal" ("name" TEXT, "type" TEXT, "age" INT, PRIMARY KEY("name"));
name: string
table name
cols: ColumnTypes
columns {name: type}
optional
opt: CreateTableOptions
options {pk}
optional
acc: string =
string to accumulate to (internal use)
SQL command for creating the table