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:170

Parameters ​

params ​
tableName ​

string

namespaces? ​

string[] | null

isTemporary? ​

boolean

isUnlogged? ​

boolean

ifNotExists? ​

boolean

columns? ​

TableColumnDefinition[]

tableConstraints? ​

TableConstraintDefinition[]

tableOptions? ​

RawString | null

asSelectQuery? ​

SelectQuery

withDataOption? ​

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

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: string[] | null

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


isTemporary ​

isTemporary: boolean

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


isUnlogged ​

isUnlogged: boolean

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

True when the table was declared with CREATE UNLOGGED TABLE (PostgreSQL).


ifNotExists ​

ifNotExists: boolean

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


columns ​

columns: TableColumnDefinition[]

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


tableConstraints ​

tableConstraints: TableConstraintDefinition[]

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


tableOptions? ​

optional tableOptions: RawString | null

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


asSelectQuery? ​

optional asSelectQuery: SelectQuery

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


withDataOption ​

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

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


comments ​

comments: string[] | null = null

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

Inherited from ​

SqlComponent.comments


positionedComments ​

positionedComments: PositionedComment[] | null = 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:198

Returns a SelectQuery that selects all columns from this table.

Returns ​

SimpleSelectQuery


getCountQuery() ​

getCountQuery(): SimpleSelectQuery

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

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.