Skip to main content
Version: 4.4

Class: DatabaseTable#

knex.DatabaseTable

Hierarchy#

  • DatabaseTable

Constructors#

constructor#

+ new DatabaseTable(name: string, schema?: string): DatabaseTable

Parameters:#

NameType
namestring
schema?string

Returns: DatabaseTable

Defined in: packages/knex/src/schema/DatabaseTable.ts:9

Properties#

columns#

Private columns: Dictionary<Column>

Defined in: packages/knex/src/schema/DatabaseTable.ts:7


foreignKeys#

Private foreignKeys: Dictionary<ForeignKey>

Defined in: packages/knex/src/schema/DatabaseTable.ts:9


indexes#

Private indexes: Index[]

Defined in: packages/knex/src/schema/DatabaseTable.ts:8


name#

Readonly name: string


schema#

Optional Readonly schema: undefined | string

Methods#

getColumn#

getColumn(name: string): undefined | Column

Parameters:#

NameType
namestring

Returns: undefined | Column

Defined in: packages/knex/src/schema/DatabaseTable.ts:18


getColumns#

getColumns(): Column[]

Returns: Column[]

Defined in: packages/knex/src/schema/DatabaseTable.ts:14


getEntityDeclaration#

getEntityDeclaration(namingStrategy: NamingStrategy, schemaHelper: SchemaHelper): EntityMetadata<any>

Parameters:#

NameType
namingStrategyNamingStrategy
schemaHelperSchemaHelper

Returns: EntityMetadata<any>

Defined in: packages/knex/src/schema/DatabaseTable.ts:58


getIndexes#

getIndexes(): Dictionary<Index[]>

Returns: Dictionary<Index[]>

Defined in: packages/knex/src/schema/DatabaseTable.ts:22


getPropertyDeclaration#

PrivategetPropertyDeclaration(column: Column, namingStrategy: NamingStrategy, schemaHelper: SchemaHelper, compositeFkIndexes: Dictionary<{ keyName: string }>, schema: EntitySchema<AnyEntity<any>, undefined>): void

Parameters:#

NameType
columnColumn
namingStrategyNamingStrategy
schemaHelperSchemaHelper
compositeFkIndexesDictionary<{ keyName: string }>
schemaEntitySchema<AnyEntity<any>, undefined>

Returns: void

Defined in: packages/knex/src/schema/DatabaseTable.ts:91


getPropertyDefaultValue#

PrivategetPropertyDefaultValue(schemaHelper: SchemaHelper, column: Column, propType: string, raw?: boolean): any

Parameters:#

NameTypeDefault value
schemaHelperSchemaHelper-
columnColumn-
propTypestring-
rawbooleanfalse

Returns: any

Defined in: packages/knex/src/schema/DatabaseTable.ts:157


getPropertyName#

PrivategetPropertyName(column: Column): string

Parameters:#

NameType
columnColumn

Returns: string

Defined in: packages/knex/src/schema/DatabaseTable.ts:133


getPropertyType#

PrivategetPropertyType(namingStrategy: NamingStrategy, schemaHelper: SchemaHelper, column: Column, defaultType?: string): string

Parameters:#

NameTypeDefault value
namingStrategyNamingStrategy-
schemaHelperSchemaHelper-
columnColumn-
defaultTypestring'string'

Returns: string

Defined in: packages/knex/src/schema/DatabaseTable.ts:143


getReferenceType#

PrivategetReferenceType(column: Column): ReferenceType

Parameters:#

NameType
columnColumn

Returns: ReferenceType

Defined in: packages/knex/src/schema/DatabaseTable.ts:121


init#

init(cols: Column[], indexes: Index[], pks: string[], fks: Dictionary<ForeignKey>, enums: Dictionary<string[]>): void

Parameters:#

NameType
colsColumn[]
indexesIndex[]
pksstring[]
fksDictionary<ForeignKey>
enumsDictionary<string[]>

Returns: void

Defined in: packages/knex/src/schema/DatabaseTable.ts:35

Last updated on by renovate[bot]