Skip to content

Latest commit

 

History

History
392 lines (212 loc) · 9.53 KB

File metadata and controls

392 lines (212 loc) · 9.53 KB

@onzag/itemize / Modules / database/CreateTableBuilder / CreateTableBuilder

Class: CreateTableBuilder

database/CreateTableBuilder.CreateTableBuilder

Reprents the basic query builder to build a bit of a query or the entire query itself and this class is supposed to be extended by other builders

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new CreateTableBuilder(): CreateTableBuilder

Builds a new create table query builder

Returns

CreateTableBuilder

Overrides

QueryBuilder.constructor

Defined in

database/CreateTableBuilder.ts:37

Properties

columns

Private columns: ICreateTableColumnDataWithExpressionAsDefault[] = []

Defined in

database/CreateTableBuilder.ts:32


createIfNotExists

Private createIfNotExists: boolean

Defined in

database/CreateTableBuilder.ts:31


tableName

Private tableName: string

Table name in question we are updating against

Defined in

database/CreateTableBuilder.ts:30

Methods

addBindingSource

addBindingSource(value): void

Adds a binding source to the binding source list in order

Parameters

Name Type Description
value ExtendedBindingType the binding source to add

Returns

void

Inherited from

QueryBuilder.addBindingSource

Defined in

database/base.ts:69


addBindingSources

addBindingSources(values): void

Adds many binding sources to the bindings sources list

Parameters

Name Type Description
values ExtendedBindingType[] the binding sources to add

Returns

void

Inherited from

QueryBuilder.addBindingSources

Defined in

database/base.ts:77


addColumn

addColumn(info): CreateTableBuilder

Adds a column to the create rule

Parameters

Name Type Description
info ICreateTableColumnData the info about the column

Returns

CreateTableBuilder

itself

Defined in

database/CreateTableBuilder.ts:48


clear

clear(): CreateTableBuilder

Clears the table name, if not exists state and columns

Returns

CreateTableBuilder

itself

Defined in

database/CreateTableBuilder.ts:93


clearBindingSources

clearBindingSources(): void

Removes all binding sources

Returns

void

Inherited from

QueryBuilder.clearBindingSources

Defined in

database/base.ts:105


compile

compile(): string

Converts this from query to a pseudo SQL query that uses ?

Returns

string

a string that represents the compiled result

Overrides

QueryBuilder.compile

Defined in

database/CreateTableBuilder.ts:105


getBindings

getBindings(): BasicBindingType[]

Provides the bindings for the query in order that should match the compilation

Returns

BasicBindingType[]

a list of basic bindings

Inherited from

QueryBuilder.getBindings

Defined in

database/base.ts:168


ifNotExists

ifNotExists(): CreateTableBuilder

Makes the update be IF NOT EXISTS

Returns

CreateTableBuilder

itself

Defined in

database/CreateTableBuilder.ts:84


popBindingSource

popBindingSource(): ExtendedBindingType

Removes the last added biding source and returns it

Returns

ExtendedBindingType

Inherited from

QueryBuilder.popBindingSource

Defined in

database/base.ts:112


shiftBindingSource

shiftBindingSource(value): void

Adds a binding source at the start of the bindings source list

Parameters

Name Type Description
value ExtendedBindingType the binding source to add

Returns

void

Inherited from

QueryBuilder.shiftBindingSource

Defined in

database/base.ts:89


shiftBindingSources

shiftBindingSources(values): void

Adds many binding sources at the start of the bindings source list

Parameters

Name Type Description
values ExtendedBindingType[] the binding sources to add

Returns

void

Inherited from

QueryBuilder.shiftBindingSources

Defined in

database/base.ts:98


table

table(tableName): CreateTableBuilder

Specifies the table we are updating

Parameters

Name Type Description
tableName string the table in question

Returns

CreateTableBuilder

itself

Defined in

database/CreateTableBuilder.ts:75


toSQL

toSQL(): IQueryBuilderSQLResult

Returns the SQL result for usage in the query builder

Returns

IQueryBuilderSQLResult

a sql builder result with the bindings and the query itself

Inherited from

QueryBuilder.toSQL

Defined in

database/base.ts:129