Version: 4.3

Class: DatabaseTable

Hierarchy

  • DatabaseTable

Constructors

constructor

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

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

Parameters:

NameType
namestring
schema?string

Returns: DatabaseTable

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

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


schema

Optional Readonly schema: string

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

Methods

getColumn

getColumn(name: string): Column | undefined

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

Parameters:

NameType
namestring

Returns: Column | undefined


getColumns

getColumns(): Column[]

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

Returns: Column[]


getEntityDeclaration

getEntityDeclaration(namingStrategy: NamingStrategy, schemaHelper: SchemaHelper): EntityMetadata

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

Parameters:

NameType
namingStrategyNamingStrategy
schemaHelperSchemaHelper

Returns: EntityMetadata


getIndexes

getIndexes(): Dictionary<Index[]>

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

Returns: Dictionary<Index[]>


getPropertyDeclaration

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

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

Parameters:

NameType
columnColumn
namingStrategyNamingStrategy
schemaHelperSchemaHelper
compositeFkIndexesDictionary<{ keyName: string }>
schemaEntitySchema

Returns: void


getPropertyDefaultValue

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

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

Parameters:

NameTypeDefault value
schemaHelperSchemaHelper-
columnColumn-
propTypestring-
rawbooleanfalse

Returns: any


getPropertyName

PrivategetPropertyName(column: Column): string

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

Parameters:

NameType
columnColumn

Returns: string


getPropertyType

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

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

Parameters:

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

Returns: string


getReferenceType

PrivategetReferenceType(column: Column): ReferenceType

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

Parameters:

NameType
columnColumn

Returns: ReferenceType


init

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

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

Parameters:

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

Returns: void

Last updated on by Martin Adámek