import { applySchema } from '@voltro/database/sql'; import { DataStore } from '@voltro/database'; import { Effect } from 'effect'; import { SqlClient } from '@effect/sql'; import { SqlDialect } from '@voltro/database'; export { applySchema } /** * Per-dialect fixture passed into the harness. `setup` runs before * each scenario, `teardown` after. Both are responsible for whatever * the dialect needs to give the scenario a clean slate — temp-file * sqlite, scratch docker postgres, etc. * * `make` returns the live `DataStore` for the scenario. Most fixtures * will close the store + drop the scratch state in `teardown`. */ export declare interface DialectFixture { readonly dialect: SqlDialect; readonly name?: string; readonly setup: () => Promise; readonly teardown: () => Promise; readonly make: () => Promise; } export declare interface DialectFixtureSession { readonly store: DataStore; /** Apply `applySchema(tables, dialect.id)` against the same runtime * the store is using, so DDL and DML hit the same database. The * fixture knows how (most dialects expose a `run` method on their * store; the fixture forwards). */ readonly migrate: (tables: ReadonlyArray) => Promise; /** * Run a raw Effect against the SAME SqlClient the store uses. * * REQUIRED, not optional: the scenarios that need it verify DDL against the * real catalog, and a fixture that could opt out would report a clean sweep of * the dialect it skipped — the exact shape of the bug this seam was added for * (a table rename verified on postgres and ASSUMED for the other four, one of * which failed outright). * * Note what does NOT enforce it: these fixtures live in `__tests__/`, which * every dialect package leaves OUT of its tsconfig include (which lists the * src glob only). So a missing `run` is a runtime TypeError, not a compile error. */ readonly run: (effect: Effect.Effect) => Promise; /** Tear down the session (close store, drop scratch DB, etc.). */ readonly dispose: () => Promise; } /** * Register the dialect's parity suite with vitest. Calls * `describe(...)` so the dialect's name appears in test output. * * Caller imports this from `@voltro/testing` inside its * `__tests__/parity.test.ts` and supplies a fixture. The fixture's * lifecycle hooks (`setup` / `teardown` / `make.dispose`) coordinate * docker / temp-file state. * * Returning early when the fixture's `setup` throws keeps CI green on * machines without docker — the fixture reports a clean skip via its * own logic before calling `runDialectParity`. We don't soft-skip here * because that would mask real fixture bugs. */ export declare const runDialectParity: (fixture: DialectFixture) => void; export { }