UNPKG

rwsdk

Version:

Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime

24 lines (23 loc) 866 B
import { Kysely, Migration, Migrator, MigrationProvider } from "kysely"; /** * A custom MigrationProvider that works with in-memory migrations * rather than reading from files. */ export declare class InMemoryMigrationProvider implements MigrationProvider { private migrations; constructor(migrations: Record<string, Migration>); getMigrations(): Promise<Record<string, Migration>>; } /** * Helper function to create a migrator using Kysely's built-in Migrator. * * @example * ```typescript * const migrator = createMigrator(db, migrations, "__my_migrations"); * const result = await migrator.migrateToLatest(); * if (result.error) { * throw new Error(`Migration failed: ${result.error}`); * } * ``` */ export declare function createMigrator(db: Kysely<any>, migrations: Record<string, Migration>, migrationTableName?: string): Migrator;