Skip to content

table.create ​

Creates a table in the model, stored in a datasource, usually the Internal Datastore. It starts with no fields; add them with table.fieldAdd.

TIP

For more control, such as other column types, indexes or keys, manage tables with SQL instead. Run CREATE, ALTER and DROP TABLE statements with DatasourceClient's execute.

js
table.create(datasourceName, tableName)

Parameters ​

ParameterTypeDescription
datasourceNamestringThe datasource to store the table in, such as Internal Datastore.
tableNamestringThe table's name.

Returns ​

boolean

true if the table was created. false if a table with that name already exists or the datasource can't be found.

Examples ​

js
const created = table.create("Internal Datastore", "users");