BetterSqliteSchemaHelper
Hierarchy
- BaseSqliteSchemaHelper
- BetterSqliteSchemaHelper
Index
Constructors
Accessors
Methods
- configureColumn
- configureColumnDefault
- createCheck
- createForeignKey
- createIndex
- createSchemaBuilder
- createTable
- createTableColumn
- databaseExists
- disableForeignKeysSQL
- dump
- enableForeignKeysSQL
- finalizeTable
- getAlterColumnAutoincrement
- getAlterNativeEnumSQL
- getAlterTable
- getChangeColumnCommentSQL
- getChecks
- getColumns
- getCreateDatabaseSQL
- getCreateIndexSQL
- getCreateNamespaceSQL
- getCreateNativeEnumSQL
- getDatabaseExistsSQL
- getDatabaseNotExistsError
- getDefaultEmptyString
- getDropColumnsSQL
- getDropDatabaseSQL
- getDropIndexSQL
- getDropNamespaceSQL
- getDropNativeEnumSQL
- getEnumDefinitions
- getForeignKeys
- getForeignKeysSQL
- getIndexes
- getListTablesSQL
- getManagementDbName
- getNamespaces
- getPostAlterTable
- getPreAlterTable
- getPrimaryKeys
- getReferencedTableName
- getRenameColumnSQL
- getRenameIndexSQL
- getSchemaBeginning
- getSchemaEnd
- getTablesGroupedBySchemas
- hasNonDefaultPrimaryKeyName
- inferLengthFromColumnType
- isImplicitIndex
- loadInformationSchema
- mapForeignKeys
- normalizeDefaultValue
- pushTableQuery
- splitTableName
- supportsSchemaConstraints
Constructors
constructor
Parameters
platform: AbstractSqlPlatform
Returns BetterSqliteSchemaHelper
Accessors
inheritedknex
Returns Knex<any, any[]>
inheritedoptions
Returns { createForeignKeyConstraints?: boolean; disableForeignKeys?: boolean; ignoreSchema?: string[]; managementDbName?: string }
optionalcreateForeignKeyConstraints?: boolean
optionaldisableForeignKeys?: boolean
optionalignoreSchema?: string[]
optionalmanagementDbName?: string
Methods
inheritedconfigureColumn
inheritedconfigureColumnDefault
inheritedcreateCheck
Parameters
table: CreateTableBuilder
check: CheckDef<unknown>
Returns void
inheritedcreateForeignKey
Parameters
table: CreateTableBuilder
foreignKey: ForeignKey
optionalschema: string
Returns void
inheritedcreateIndex
Parameters
table: CreateTableBuilder
index: IndexDef
tableDef: DatabaseTable
createPrimary: boolean = false
Returns void
inheritedcreateSchemaBuilder
Parameters
optionalschema: string
Returns SchemaBuilder
inheritedcreateTable
Parameters
tableDef: DatabaseTable
optionalalter: boolean
Returns SchemaBuilder
inheritedcreateTableColumn
Parameters
table: TableBuilder
column: Column
fromTable: DatabaseTable
optionalchangedProperties: Set<string>
optionalalter: boolean
Returns undefined | ColumnBuilder
inheriteddatabaseExists
Parameters
connection: Connection
name: string
Returns Promise<boolean>
inheriteddisableForeignKeysSQL
Returns string
inheriteddump
Parameters
builder: string | SchemaBuilder
append: string
Returns Promise<string>
inheritedenableForeignKeysSQL
Returns string
inheritedfinalizeTable
Parameters
table: TableBuilder
charset: string
optionalcollate: string
Returns void
inheritedgetAlterColumnAutoincrement
Parameters
tableName: string
column: Column
optionalschemaName: string
Returns string
inheritedgetAlterNativeEnumSQL
Parameters
name: string
optionalschema: string
optionalvalue: string
optionalitems: string[]
optionaloldItems: string[]
Returns string
inheritedgetAlterTable
Parameters
changedTable: TableDifference
optionalwrap: boolean
Returns Promise<string>
inheritedgetChangeColumnCommentSQL
Parameters
tableName: string
to: Column
optionalschemaName: string
Returns string
inheritedgetChecks
Parameters
connection: AbstractSqlConnection
tableName: string
optionalschemaName: string
Returns Promise<CheckDef<unknown>[]>
inheritedgetColumns
Parameters
connection: AbstractSqlConnection
tableName: string
optionalschemaName: string
Returns Promise<any[]>
inheritedgetCreateDatabaseSQL
Parameters
name: string
Returns string
inheritedgetCreateIndexSQL
Parameters
tableName: string
index: IndexDef
partialExpression: boolean = false
Returns string
inheritedgetCreateNamespaceSQL
Parameters
name: string
Returns string
inheritedgetCreateNativeEnumSQL
Parameters
name: string
values: unknown[]
optionalschema: string
Returns string
inheritedgetDatabaseExistsSQL
Parameters
name: string
Returns string
inheritedgetDatabaseNotExistsError
Parameters
dbName: string
Returns string
inheritedgetDefaultEmptyString
Returns string
inheritedgetDropColumnsSQL
Parameters
tableName: string
columns: Column[]
optionalschemaName: string
Returns string
inheritedgetDropDatabaseSQL
Parameters
name: string
Returns string
inheritedgetDropIndexSQL
Parameters
tableName: string
index: IndexDef
Returns string
inheritedgetDropNamespaceSQL
Parameters
name: string
Returns string
inheritedgetDropNativeEnumSQL
Parameters
name: string
optionalschema: string
Returns string
inheritedgetEnumDefinitions
Parameters
connection: AbstractSqlConnection
checks: CheckDef<unknown>[]
tableName: string
schemaName: string
Returns Promise<Dictionary<string[]>>
inheritedgetForeignKeys
Parameters
connection: AbstractSqlConnection
tableName: string
optionalschemaName: string
Returns Promise<Dictionary>
inheritedgetForeignKeysSQL
Parameters
tableName: string
Returns string
inheritedgetIndexes
Parameters
connection: AbstractSqlConnection
tableName: string
optionalschemaName: string
Returns Promise<IndexDef[]>
inheritedgetListTablesSQL
Returns string
inheritedgetManagementDbName
Returns string
inheritedgetNamespaces
Parameters
connection: AbstractSqlConnection
Returns Promise<string[]>
inheritedgetPostAlterTable
Parameters
tableDiff: TableDifference
safe: boolean
Returns string
inheritedgetPreAlterTable
Parameters
tableDiff: TableDifference
safe: boolean
Returns string
inheritedgetPrimaryKeys
Parameters
connection: AbstractSqlConnection
indexes: IndexDef[]
tableName: string
optionalschemaName: string
Returns Promise<string[]>
inheritedgetReferencedTableName
Parameters
referencedTableName: string
optionalschema: string
Returns string
inheritedgetRenameColumnSQL
Parameters
tableName: string
oldColumnName: string
to: Column
optionalschemaName: string
Returns string
inheritedgetRenameIndexSQL
Parameters
tableName: string
index: IndexDef
oldIndexName: string
Returns string
inheritedgetSchemaBeginning
Parameters
charset: string
optionaldisableForeignKeys: boolean
Returns string
inheritedgetSchemaEnd
Parameters
optionaldisableForeignKeys: boolean
Returns string
inheritedgetTablesGroupedBySchemas
inheritedhasNonDefaultPrimaryKeyName
Parameters
table: DatabaseTable
Returns boolean
inheritedinferLengthFromColumnType
Parameters
type: string
Returns undefined | number
inheritedisImplicitIndex
Parameters
name: string
Returns boolean
inheritedloadInformationSchema
Parameters
schema: DatabaseSchema
connection: AbstractSqlConnection
tables: Table[]
optionalschemas: string[]
Returns Promise<void>
inheritedmapForeignKeys
Parameters
fks: any[]
tableName: string
Returns Dictionary
inheritednormalizeDefaultValue
Parameters
defaultValue: string
optionallength: number
defaultValues: Dictionary<string[]> = {}
Returns string | number
inheritedpushTableQuery
Uses
raw
method injected inAbstractSqlConnection
to allow adding custom queries inside alter statements.Parameters
table: TableBuilder
expression: string
grouping: string = 'alterTable'
Returns void
inheritedsplitTableName
Parameters
name: string
Returns [undefined | string, string]
inheritedsupportsSchemaConstraints
Returns boolean
Implicit indexes will be ignored when diffing