Skip to content

Database.createTable() method

Home > @direct-sqlite/core > Database > createTable

Creates a table based on the provided configuration and returns a TableRunner for that table.

Signature:

createTable<T extends {
$name: string;
$createSql: string;
$infer: any;
}>(tableConfig: T): TableRunner<T["$infer"]>;

Parameter

Type

Description

tableConfig

T

An object containing the table name, SQL creation statement, and an inference type for the table’s rows.

Returns:

TableRunner<T[“$infer”]>

A TableRunner instance for the created table.