Skip to content
# Class: CreateTableQuery

Defined in: packages/core/src/models/CreateTableQuery.ts:156

Extends

Constructors

Constructor

new CreateTableQuery(params): CreateTableQuery

Defined in: packages/core/src/models/CreateTableQuery.ts:168

Parameters

params
tableName

string

namespaces?

null | string[]

isTemporary?

boolean

ifNotExists?

boolean

columns?

TableColumnDefinition[]

tableConstraints?

TableConstraintDefinition[]

tableOptions?

null | RawString

asSelectQuery?

SelectQuery

withDataOption?

null | "with-data" | "with-no-data"

Returns

CreateTableQuery

Overrides

SqlComponent.constructor

Properties

kind

static kind: symbol

Defined in: packages/core/src/models/CreateTableQuery.ts:157

Overrides

SqlComponent.kind


tableName

tableName: IdentifierString

Defined in: packages/core/src/models/CreateTableQuery.ts:158


namespaces

namespaces: null | string[]

Defined in: packages/core/src/models/CreateTableQuery.ts:159


isTemporary

isTemporary: boolean

Defined in: packages/core/src/models/CreateTableQuery.ts:160


ifNotExists

ifNotExists: boolean

Defined in: packages/core/src/models/CreateTableQuery.ts:161


columns

columns: TableColumnDefinition[]

Defined in: packages/core/src/models/CreateTableQuery.ts:162


tableConstraints

tableConstraints: TableConstraintDefinition[]

Defined in: packages/core/src/models/CreateTableQuery.ts:163


tableOptions?

optional tableOptions: null | RawString

Defined in: packages/core/src/models/CreateTableQuery.ts:164


asSelectQuery?

optional asSelectQuery: SelectQuery

Defined in: packages/core/src/models/CreateTableQuery.ts:165


withDataOption

withDataOption: null | "with-data" | "with-no-data"

Defined in: packages/core/src/models/CreateTableQuery.ts:166


comments

comments: null | string[] = null

Defined in: packages/core/src/models/SqlComponent.ts:29

Inherited from

SqlComponent.comments


positionedComments

positionedComments: null | PositionedComment[] = null

Defined in: packages/core/src/models/SqlComponent.ts:32

Inherited from

SqlComponent.positionedComments

Methods

getSelectQuery()

getSelectQuery(): SimpleSelectQuery

Defined in: packages/core/src/models/CreateTableQuery.ts:194

Returns a SelectQuery that selects all columns from this table.

Returns

SimpleSelectQuery


getCountQuery()

getCountQuery(): SimpleSelectQuery

Defined in: packages/core/src/models/CreateTableQuery.ts:233

Returns a SelectQuery that counts all rows in this table.

Returns

SimpleSelectQuery


getKind()

getKind(): symbol

Defined in: packages/core/src/models/SqlComponent.ts:15

Returns

symbol

Inherited from

SqlComponent.getKind


accept()

accept<T&gt;(visitor): T

Defined in: packages/core/src/models/SqlComponent.ts:19

Type Parameters

T

T

Parameters

visitor

SqlComponentVisitor<T&gt;

Returns

T

Inherited from

SqlComponent.accept


toSqlString()

toSqlString(formatter): string

Defined in: packages/core/src/models/SqlComponent.ts:23

Parameters

formatter

SqlComponentVisitor<string&gt;

Returns

string

Inherited from

SqlComponent.toSqlString


addPositionedComments()

addPositionedComments(position, comments): void

Defined in: packages/core/src/models/SqlComponent.ts:37

Add comments at a specific position

Parameters

position

"before" | "after"

comments

string[]

Returns

void

Inherited from

SqlComponent.addPositionedComments


getPositionedComments()

getPositionedComments(position): string[]

Defined in: packages/core/src/models/SqlComponent.ts:56

Get comments for a specific position

Parameters

position

"before" | "after"

Returns

string[]

Inherited from

SqlComponent.getPositionedComments


getAllPositionedComments()

getAllPositionedComments(): string[]

Defined in: packages/core/src/models/SqlComponent.ts:66

Get all positioned comments as a flat array in order (before, after)

Returns

string[]

Inherited from

SqlComponent.getAllPositionedComments

Released under the MIT License.