Skip to main content

CreateTable

Creates a new table with a defined structure.


Methods


selectDatabase()

→ (database = String) → this

Selects a specific database for the query.

Parameters

ParameterTypeDescription
databaseStringThe name of the database to select.

Returns

this


name()

→ (name = String) → this

Sets the name of the new table.

Parameters

ParameterTypeDescription
nameStringThe name of the table.

Returns

this


structure()

→ (structure = Structure) → this

Defines the desired structure for the new table.

Parameters

ParameterTypeDescription
structureStructureThe structure of the table.

Returns

this


execute()

async → () → OkPacket

Executes the query and creates the table.

Possible Crash

The structure() method must be called before execution.

Returns

OkPacket