abstractSchemaHelper
Hierarchy
- SchemaHelper
- SqliteSchemaHelper
- BetterSqliteSchemaHelper
- MariaDbSchemaHelper
- MySqlSchemaHelper
- PostgreSqlSchemaHelper
Index
Constructors
Methods
- configureColumn
- configureColumnDefault
- createTableColumn
- databaseExists
- disableForeignKeysSQL
- enableForeignKeysSQL
- finalizeTable
- getAlterColumnAutoincrement
- getChangeColumnCommentSQL
- getChecks
- getColumns
- getCreateDatabaseSQL
- getCreateIndexSQL
- getDatabaseExistsSQL
- getDatabaseNotExistsError
- getDefaultEmptyString
- getDropDatabaseSQL
- getDropIndexSQL
- getEnumDefinitions
- getForeignKeys
- getForeignKeysSQL
- getIndexes
- getListTablesSQL
- getManagementDbName
- getNamespaces
- getPreAlterTable
- getPrimaryKeys
- getRenameColumnSQL
- getRenameIndexSQL
- getSchemaBeginning
- getSchemaEnd
- hasNonDefaultPrimaryKeyName
- loadInformationSchema
- mapForeignKeys
- normalizeDefaultValue
- pushTableQuery
- supportsSchemaConstraints
Constructors
constructor
Parameters
platform: AbstractSqlPlatform
Returns SchemaHelper
Methods
configureColumn
Parameters
column: Column
col: ColumnBuilder
knex: Knex<any, any[]>
optionalchangedProperties: Set<string>
Returns ColumnBuilder
configureColumnDefault
Parameters
column: Column
col: ColumnBuilder
knex: Knex<any, any[]>
optionalchangedProperties: Set<string>
Returns ColumnBuilder
createTableColumn
Parameters
table: TableBuilder
column: Column
fromTable: DatabaseTable
optionalchangedProperties: Set<string>
Returns ColumnBuilder
databaseExists
Parameters
connection: Connection
name: string
Returns Promise<boolean>
disableForeignKeysSQL
Returns string
enableForeignKeysSQL
Returns string
finalizeTable
Parameters
table: TableBuilder
charset: string
optionalcollate: string
Returns void
getAlterColumnAutoincrement
Parameters
tableName: string
column: Column
optionalschemaName: string
Returns string
getChangeColumnCommentSQL
Parameters
tableName: string
to: Column
optionalschemaName: string
Returns string
getChecks
Parameters
connection: AbstractSqlConnection
tableName: string
optionalschemaName: string
optionalcolumns: Column[]
Returns Promise<Check<unknown>[]>
getColumns
Parameters
connection: AbstractSqlConnection
tableName: string
optionalschemaName: string
Returns Promise<Column[]>
getCreateDatabaseSQL
Parameters
name: string
Returns string
getCreateIndexSQL
Parameters
tableName: string
index: Index
Returns string
getDatabaseExistsSQL
Parameters
name: string
Returns string
getDatabaseNotExistsError
Parameters
dbName: string
Returns string
getDefaultEmptyString
Returns string
getDropDatabaseSQL
Parameters
name: string
Returns string
getDropIndexSQL
Parameters
tableName: string
index: Index
Returns string
getEnumDefinitions
Parameters
connection: AbstractSqlConnection
checks: Check<unknown>[]
tableName: string
optionalschemaName: string
Returns Promise<Dictionary<string[]>>
getForeignKeys
Parameters
connection: AbstractSqlConnection
tableName: string
optionalschemaName: string
Returns Promise<Dictionary>
getForeignKeysSQL
Parameters
tableName: string
optionalschemaName: string
Returns string
getIndexes
Parameters
connection: AbstractSqlConnection
tableName: string
optionalschemaName: string
Returns Promise<Index[]>
getListTablesSQL
Parameters
optionalschemaName: string
Returns string
getManagementDbName
Returns string
getNamespaces
Parameters
connection: AbstractSqlConnection
Returns Promise<string[]>
getPreAlterTable
Parameters
tableDiff: TableDifference
safe: boolean
Returns string
getPrimaryKeys
Parameters
connection: AbstractSqlConnection
indexes: Index[] = []
tableName: string
optionalschemaName: string
Returns Promise<string[]>
getRenameColumnSQL
Parameters
tableName: string
oldColumnName: string
to: Column
optionalschemaName: string
Returns string
getRenameIndexSQL
Parameters
tableName: string
index: Index
oldIndexName: string
Returns string
getSchemaBeginning
Parameters
charset: string
Returns string
getSchemaEnd
Returns string
hasNonDefaultPrimaryKeyName
Parameters
table: DatabaseTable
Returns boolean
loadInformationSchema
Parameters
schema: DatabaseSchema
connection: AbstractSqlConnection
tables: Table[]
Returns Promise<void>
mapForeignKeys
Parameters
fks: any[]
tableName: string
optionalschemaName: string
Returns Dictionary
normalizeDefaultValue
Parameters
defaultValue: string
optionallength: number
defaultValues: Dictionary<string[]> = {}
Returns string | number
pushTableQuery
Parameters
table: TableBuilder
expression: string
grouping: string = 'alterTable'
Returns void
supportsSchemaConstraints
Returns boolean
Uses
raw
method injected inAbstractSqlConnection
to allow adding custom queries inside alter statements.