Skip to main content
Version: 5.2

abstractSchemaHelper

Hierarchy

Index

Constructors

constructor

Methods

configureColumn

  • configureColumn(column: Column, col: ColumnBuilder, knex: Knex<any, any[]>, changedProperties?: Set<string>): ColumnBuilder
  • Parameters

    • column: Column
    • col: ColumnBuilder
    • knex: Knex<any, any[]>
    • optionalchangedProperties: Set<string>

    Returns ColumnBuilder

configureColumnDefault

  • configureColumnDefault(column: Column, col: ColumnBuilder, knex: Knex<any, any[]>, changedProperties?: Set<string>): ColumnBuilder
  • Parameters

    • column: Column
    • col: ColumnBuilder
    • knex: Knex<any, any[]>
    • optionalchangedProperties: Set<string>

    Returns ColumnBuilder

createTableColumn

  • createTableColumn(table: TableBuilder, column: Column, fromTable: DatabaseTable, changedProperties?: Set<string>): ColumnBuilder
  • Parameters

    • table: TableBuilder
    • column: Column
    • fromTable: DatabaseTable
    • optionalchangedProperties: Set<string>

    Returns ColumnBuilder

databaseExists

  • databaseExists(connection: Connection, name: string): Promise<boolean>
  • Parameters

    Returns Promise<boolean>

disableForeignKeysSQL

  • disableForeignKeysSQL(): string
  • Returns string

enableForeignKeysSQL

  • enableForeignKeysSQL(): string
  • Returns string

finalizeTable

  • finalizeTable(table: TableBuilder, charset: string, collate?: string): void
  • Parameters

    • table: TableBuilder
    • charset: string
    • optionalcollate: string

    Returns void

getAlterColumnAutoincrement

  • getAlterColumnAutoincrement(tableName: string, column: Column): string
  • Parameters

    • tableName: string
    • column: Column

    Returns string

getChangeColumnCommentSQL

  • getChangeColumnCommentSQL(tableName: string, to: Column): string
  • Parameters

    Returns string

getChecks

getColumns

getCreateDatabaseSQL

  • getCreateDatabaseSQL(name: string): string
  • Parameters

    • name: string

    Returns string

getCreateIndexSQL

  • getCreateIndexSQL(tableName: string, index: Index): string
  • Parameters

    • tableName: string
    • index: Index

    Returns string

getDatabaseExistsSQL

  • getDatabaseExistsSQL(name: string): string
  • Parameters

    • name: string

    Returns string

getDatabaseNotExistsError

  • getDatabaseNotExistsError(dbName: string): string
  • Parameters

    • dbName: string

    Returns string

getDefaultEmptyString

  • getDefaultEmptyString(): string
  • Returns string

getDropDatabaseSQL

  • getDropDatabaseSQL(name: string): string
  • Parameters

    • name: string

    Returns string

getDropIndexSQL

  • getDropIndexSQL(tableName: string, index: Index): string
  • Parameters

    • tableName: string
    • index: Index

    Returns string

getEnumDefinitions

getForeignKeys

getForeignKeysSQL

  • getForeignKeysSQL(tableName: string, schemaName?: string): string
  • Parameters

    • tableName: string
    • optionalschemaName: string

    Returns string

getIndexes

getListTablesSQL

  • getListTablesSQL(schemaName?: string): string
  • Parameters

    • optionalschemaName: string

    Returns string

getManagementDbName

  • getManagementDbName(): string
  • Returns string

getNamespaces

getPreAlterTable

getPrimaryKeys

getRenameColumnSQL

  • getRenameColumnSQL(tableName: string, oldColumnName: string, to: Column): string
  • Parameters

    • tableName: string
    • oldColumnName: string
    • to: Column

    Returns string

getRenameIndexSQL

  • getRenameIndexSQL(tableName: string, index: Index, oldIndexName: string): string
  • Parameters

    • tableName: string
    • index: Index
    • oldIndexName: string

    Returns string

getSchemaBeginning

  • getSchemaBeginning(charset: string): string
  • Parameters

    • charset: string

    Returns string

getSchemaEnd

  • getSchemaEnd(): string
  • Returns string

hasNonDefaultPrimaryKeyName

  • hasNonDefaultPrimaryKeyName(table: DatabaseTable): boolean
  • Parameters

    • table: DatabaseTable

    Returns boolean

mapForeignKeys

  • mapForeignKeys(fks: any[], tableName: string, schemaName?: string): Dictionary<any>
  • Parameters

    • fks: any[]
    • tableName: string
    • optionalschemaName: string

    Returns Dictionary<any>

normalizeDefaultValue

  • normalizeDefaultValue(defaultValue: string, length?: number, defaultValues?: Dictionary<string[]>): string | number
  • Parameters

    • defaultValue: string
    • optionallength: number
    • defaultValues: Dictionary<string[]> = {}

    Returns string | number

pushTableQuery

  • pushTableQuery(table: TableBuilder, expression: string, grouping?: string): void
  • Uses raw method injected in AbstractSqlConnection to allow adding custom queries inside alter statements.


    Parameters

    • table: TableBuilder
    • expression: string
    • grouping: string = 'alterTable'

    Returns void

supportsSchemaConstraints

  • supportsSchemaConstraints(): boolean
  • Returns boolean