import { type PGlite } from '@electric-sql/pglite'; import { type MigrationList, type SchemaContainer, type SchemaEngine } from '@prisma/schema-engine-wasm/schema_engine_bg'; /** * Empty schema filter (no externally-managed tables or enums). Required by the schema engine's * migration commands. * * @category Internal */ export declare const emptySchemaFilter: { externalTables: never[]; externalEnums: never[]; }; /** * Run a callback with a WASM schema engine connected to the given PGlite instance through this * package's migration-aware driver adapter. The engine is freed afterwards; the PGlite instance is * left open. * * @category Internal */ export declare function withSchemaEngine(pglite: PGlite, callback: (engine: SchemaEngine) => Promise): Promise; /** * Reads a Prisma schema (a single `.prisma` file or a schema folder) into the `SchemaContainer` * list the schema engine expects. * * @category Internal */ export declare function readSchemaContainers(schemaPath: string): Promise; /** * Migration lock file name required by Prisma to deploy migrations. * * @category Internal */ export declare const migrationLockFileName = "migration_lock.toml"; /** * Reads the migrations directory into the `MigrationList` the schema engine expects. Returns an * empty list (no migration directories) if the directory does not exist. * * @category Internal */ export declare function readMigrationList(migrationsDirPath: string): Promise; /** * Generates the SQL for the next migration by diffing the database backing `shadowPglite` (after * the existing migration history has been replayed into it) against the target schema. This avoids * Prisma's shadow-database requirement (unimplemented for PostgreSQL in the WASM engine) by using a * throwaway PGlite instance as the diff baseline. * * @category Internal * @returns The migration SQL, or `undefined` if there are no changes. */ export declare function diffMigrationSql({ shadowPglite, existingMigrations, schemaContainers, schemaConfigDir, }: Readonly<{ shadowPglite: PGlite; existingMigrations: MigrationList; schemaContainers: SchemaContainer[]; schemaConfigDir: string; }>): Promise; /** * Brings the database backing `pglite` up to the given schema: applies the migration history when * migrations exist, otherwise pushes the schema directly (equivalent to `prisma db push`). * * @category Internal */ export declare function applyMigrationsOrPushSchema({ pglite, migrations, schemaContainers, }: Readonly<{ pglite: PGlite; migrations: MigrationList; schemaContainers: SchemaContainer[]; }>): Promise;