CreateTable
Creates a new table with a defined structure.
Methods
selectDatabase()
→ (database = String) → this
Selects a specific database for the query.
Parameters
| Parameter | Type | Description |
|---|---|---|
database | String | The name of the database to select. |
Returns
→ this
name()
→ (name = String) → this
Sets the name of the new table.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | String | The name of the table. |
Returns
→ this
structure()
→ (structure = Structure) → this
Defines the desired structure for the new table.
Parameters
| Parameter | Type | Description |
|---|---|---|
structure | Structure | The 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