import type { Dialect } from '../dialect.js'; import type { Client } from '../types.js'; import type { SqlfuMigrationPreset } from '../types.js'; import { type DualGenerator } from '../dual-dispatch.js'; declare const SQLFU_TABLE = "sqlfu_migrations"; declare const D1_TABLE = "d1_migrations"; /** * The canonical sqlfu migration-table DDL. Used directly when no dialect is * passed (inline `defineConfig().migrate()`, generated migration bundles) and * re-exported as `sqliteDialect().defaultMigrationTableDdl`, so every sqlite * path creates an identical table. Dialects with different column flavors * (e.g. `@sqlfu/pg`'s timestamptz) override via `defaultMigrationTableDdl`. */ export declare const sqlfuMigrationTableDdl: (tableName: string) => string; export type ResolvedPresetShape = { kind: 'sqlfu'; table: typeof SQLFU_TABLE; hasChecksum: true; } | { kind: 'd1'; table: typeof D1_TABLE; hasChecksum: false; variant: 'remote' | 'local'; }; export declare function presetTableName(preset: SqlfuMigrationPreset): string; export declare function ensureMigrationTableGen(client: Client, preset: SqlfuMigrationPreset, dialect?: Pick): DualGenerator; export type MigrationHistoryRow = { name: string; applied_at: string; checksum?: string; id?: string; type?: string; }; export declare function selectHistoryQuery(shape: ResolvedPresetShape): { sql: string; args: never[]; name: string; }; /** * Alchemy stores migration filenames with the `.sql` suffix in `d1_migrations` * (both remote and local variants). Sqlfu's internal representation drops the * suffix via `migrationName()`. These helpers normalize at the read/write * boundary so callers can keep operating on the sqlfu-native form regardless * of preset. */ export declare function normalizeHistoryName(shape: ResolvedPresetShape, name: string): string; export declare function serializeHistoryName(shape: ResolvedPresetShape, name: string): string; export declare function deleteHistoryQuery(shape: ResolvedPresetShape): { sql: string; args: never[]; name: string; }; export type InsertMigrationParams = { name: string; checksum: string; applied_at: string; }; export declare function insertMigrationQuery(shape: ResolvedPresetShape, params: InsertMigrationParams): { sql: string; args: string[]; name: string; }; export {};