PgliteSchemaGenerator
Hierarchy
- SqlSchemaGenerator
- PgliteSchemaGenerator
Index
Constructors
constructor
Methods
inheritedclear
Parameters
optionaloptions: ClearDatabaseOptions
Returns Promise<void>
inheritedcreate
Parameters
optionaloptions: CreateSchemaOptions
Returns Promise<void>
createDatabase
creates new database and connects to it
Parameters
optionalname: string
optionaloptions: { skipOnConnect?: boolean }
optionalskipOnConnect: boolean
Returns Promise<void>
inheritedcreateNamespace
Parameters
name: string
Returns Promise<void>
inheriteddiffToSQL
Parameters
schemaDiff: SchemaDifference
options: { dropTables?: boolean; safe?: boolean; schema?: string; wrap?: boolean }
optionaldropTables: boolean
optionalsafe: boolean
optionalschema: string
optionalwrap: boolean
Returns string
inheriteddrop
Parameters
options: DropSchemaOptions = {}
Returns Promise<void>
dropDatabase
Parameters
optionalname: string
Returns Promise<void>
inheriteddropNamespace
Parameters
name: string
Returns Promise<void>
inheriteddropTableIfExists
Parameters
name: string
optionalschema: string
Returns Promise<void>
inheritedensureDatabase
Returns true if the database was created.
Parameters
optionaloptions: EnsureDatabaseOptions
Returns Promise<boolean>
inheritedensureIndexes
Returns Promise<void>
inheritedexecute
Parameters
sql: string
options: { ctx?: any; wrap?: boolean } = {}
optionalctx: any
optionalwrap: boolean
Returns Promise<void>
inheritedgetCreateSchemaSQL
Parameters
options: CreateSchemaOptions = {}
Returns Promise<string>
inheritedgetDropSchemaSQL
Parameters
options: Omit<DropSchemaOptions, dropDb> = {}
Returns Promise<string>
inheritedgetTargetSchema
Parameters
optionalschema: string
includeWildcardSchema: boolean = false
Returns DatabaseSchema
inheritedgetUpdateSchemaMigrationSQL
Parameters
options: UpdateSchemaOptions<DatabaseSchema> = {}
Returns Promise<{ down: string; up: string }>
inheritedgetUpdateSchemaSQL
Parameters
options: UpdateSchemaOptions<DatabaseSchema> = {}
Returns Promise<string>
inheritedrefresh
Parameters
optionaloptions: RefreshDatabaseOptions
Returns Promise<void>
inheritedupdate
Parameters
options: UpdateSchemaOptions<DatabaseSchema> = {}
Returns Promise<void>
staticregister
Parameters
orm: SqlMikroORM<PgliteDriver, SqlEntityManager<PgliteDriver>, (string | EntityClass<Partial<any>> | EntitySchema<any, never, EntityCtor<any>>)[]>
Returns void
In the default (single-database) setup a PGlite instance maps 1:1 to its
dataDir, so there are no separate databases to create or drop and both operations are no-ops. The inherited implementation would otherwise switchdbNameand reconnect, rebuilding the instance with the new name as itsdataDir— materializing a stray on-disk data directory. Named-database mode (driverOptions.dataDirset) keeps the realCREATE DATABASElifecycle.