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

Parameter | Type | Description
--- | --- | ---
`database` | String | 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 | Name for the table

Returns

→ `this`

### structure()​

→ (`structure` = Structure) → `this`

The desired structure for the table to get.

Parameters

Parameter | Type | Description
--- | --- | ---
`structure` | Structure | Structure 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