From 8dece561f9b4068cb7e1db4a2b761262bfcd68b1 Mon Sep 17 00:00:00 2001 From: AndriiSherman Date: Mon, 16 Sep 2024 12:13:30 +0300 Subject: [PATCH] Add pglite to monomigrator --- drizzle-orm/src/monomigrator.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drizzle-orm/src/monomigrator.ts b/drizzle-orm/src/monomigrator.ts index 77d1c8da4..1736e415e 100644 --- a/drizzle-orm/src/monomigrator.ts +++ b/drizzle-orm/src/monomigrator.ts @@ -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'; @@ -29,7 +30,8 @@ export async function migrate( | PlanetScaleDatabase | PostgresJsDatabase | VercelPgDatabase - | TiDBServerlessDatabase, + | TiDBServerlessDatabase + | PgliteDatabase, config: MigrationConfig, ) { switch (( db).constructor[entityKind]) { @@ -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); + } } }