migrator.d.ts 805 B

1234567891011121314151617181920212223242526272829
  1. import type { ExpoSQLiteDatabase } from "./driver.js";
  2. interface MigrationConfig {
  3. journal: {
  4. entries: {
  5. idx: number;
  6. when: number;
  7. tag: string;
  8. breakpoints: boolean;
  9. }[];
  10. };
  11. migrations: Record<string, string>;
  12. }
  13. export declare function migrate<TSchema extends Record<string, unknown>>(db: ExpoSQLiteDatabase<TSchema>, config: MigrationConfig): Promise<void>;
  14. interface State {
  15. success: boolean;
  16. error?: Error;
  17. }
  18. export declare const useMigrations: (db: ExpoSQLiteDatabase<any>, migrations: {
  19. journal: {
  20. entries: {
  21. idx: number;
  22. when: number;
  23. tag: string;
  24. breakpoints: boolean;
  25. }[];
  26. };
  27. migrations: Record<string, string>;
  28. }) => State;
  29. export {};