SqlSchemaGenerator
Hierarchy
- AbstractSchemaGenerator<AbstractSqlDriver>
- SqlSchemaGenerator
Implements
Index
Constructors
constructor
Parameters
em: EntityManager<IDatabaseDriver<Connection>> | AbstractSqlDriver<AbstractSqlConnection, AbstractSqlPlatform>
Returns SqlSchemaGenerator
Methods
clearDatabase
Parameters
optionaloptions: ClearDatabaseOptions
Returns Promise<void>
createDatabase
Parameters
optionalname: string
Returns Promise<void>
createNamespace
Parameters
name: string
Returns Promise<void>
createSchema
Parameters
optionaloptions: CreateSchemaOptions
Returns Promise<void>
diffToSQL
Parameters
schemaDiff: SchemaDifference
options: { dropTables?: boolean; safe?: boolean; schema?: string; wrap?: boolean }
optionaldropTables: boolean
optionalsafe: boolean
optionalschema: string
optionalwrap: boolean
Returns Promise<string>
dropDatabase
Parameters
optionalname: string
Returns Promise<void>
dropNamespace
Parameters
name: string
Returns Promise<void>
dropSchema
Parameters
options: DropSchemaOptions = {}
Returns Promise<void>
ensureDatabase
Returns true if the database was created.
Parameters
optionaloptions: EnsureDatabaseOptions
Returns Promise<boolean>
inheritedensureIndexes
Returns Promise<void>
execute
Parameters
sql: string
options: { ctx?: any; wrap?: boolean } = {}
optionalctx: any
optionalwrap: boolean
Returns Promise<void>
getCreateSchemaSQL
Parameters
options: CreateSchemaOptions = {}
Returns Promise<string>
getDropSchemaSQL
Parameters
options: Omit<DropSchemaOptions, dropDb> = {}
Returns Promise<string>
getTargetSchema
Parameters
optionalschema: string
Returns DatabaseSchema
getUpdateSchemaMigrationSQL
Parameters
options: UpdateSchemaOptions<DatabaseSchema> = {}
Returns Promise<{ down: string; up: string }>
getUpdateSchemaSQL
Parameters
options: UpdateSchemaOptions<DatabaseSchema> = {}
Returns Promise<string>
inheritedrefreshDatabase
Parameters
optionaloptions: RefreshDatabaseOptions
Returns Promise<void>
updateSchema
Parameters
options: UpdateSchemaOptions<DatabaseSchema> = {}
Returns Promise<void>
staticregister
Parameters
Returns void
creates new database and connects to it