migrator.d.cts 735 B

12345678910111213
  1. import type { XataHttpDatabase } from "./driver.cjs";
  2. export interface MigrationConfig {
  3. migrationsFolder: string;
  4. migrationsTable?: string;
  5. }
  6. /**
  7. * This function reads migrationFolder and execute each unapplied migration and mark it as executed in database
  8. *
  9. * NOTE: The Xata HTTP driver does not support transactions. This means that if any part of a migration fails,
  10. * no rollback will be executed. Currently, you will need to handle unsuccessful migration yourself.
  11. * @param db - drizzle db instance
  12. * @param config - path to migration folder generated by drizzle-kit
  13. */ export declare function migrate<TSchema extends Record<string, unknown>>(db: XataHttpDatabase<TSchema>, config: MigrationConfig): Promise<void>;