Skip to content

Commit

Permalink
Add pglite to monomigrator
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiSherman committed Sep 16, 2024
1 parent f026b0e commit 8dece56
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drizzle-orm/src/monomigrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { MySql2Database } from './mysql2/index.ts';
import type { NeonHttpDatabase } from './neon-http/index.ts';
import type { NeonDatabase } from './neon-serverless/index.ts';
import type { NodePgDatabase } from './node-postgres/index.ts';
import type { PgliteDatabase } from './pglite/driver.ts';
import type { PlanetScaleDatabase } from './planetscale-serverless/index.ts';
import type { PostgresJsDatabase } from './postgres-js/index.ts';
import type { TiDBServerlessDatabase } from './tidb-serverless/index.ts';
Expand All @@ -29,7 +30,8 @@ export async function migrate(
| PlanetScaleDatabase<any>
| PostgresJsDatabase<any>
| VercelPgDatabase<any>
| TiDBServerlessDatabase<any>,
| TiDBServerlessDatabase<any>
| PgliteDatabase<any>,
config: MigrationConfig,
) {
switch ((<any> db).constructor[entityKind]) {
Expand Down Expand Up @@ -98,5 +100,10 @@ export async function migrate(

return migrate(db as VercelPgDatabase, config as MigrationConfig);
}
case 'PgliteDatabase': {
const { migrate } = await import('./pglite/migrator');

return migrate(db as PgliteDatabase, config as MigrationConfig);
}
}
}

0 comments on commit 8dece56

Please sign in to comment.