Skip to main content

CreateTable

Creates a new table with defined structure.

Methods

selectDatabase()

→ (database = String) → this

Selects a different database for this query.

Parameters

ParameterTypeDescription
databaseStringName of the database to select

Returns

this


name()

→ (name = String) → this

Sets the name of the new table.

Parameters

ParameterTypeDescription
nameStringName for the table

Returns

this


structure()

→ (structure = Structure) → this

The desired structure for the table to get.

Parameters

ParameterTypeDescription
structureStructureStructure for the table.

Returns

this


execute()

async → () → any

Possible crash

structure() must always be given.

Executes the prepared query.

Returns

any - The result of 'CREATE TABLE [...]'-query