import type { Effect } from 'effect'; import type { SQLiteRow, SQLiteValue } from '../item-schema/index.js'; export type { SQLiteRow, SQLiteValue }; export interface SQLiteRunResult { readonly changes: number; } export interface SQLiteStatement { readonly sql: string; readonly parameters?: readonly SQLiteValue[]; readonly expectedChanges?: number; } export class SQLiteChangesMismatch extends Error { constructor(readonly index: number) { super(`SQLite statement ${index} changed an unexpected number of rows`); } } export interface SQLiteDriver { readonly run: ( sql: string, parameters?: readonly SQLiteValue[], ) => Effect.Effect; readonly all: ( sql: string, parameters?: readonly SQLiteValue[], ) => Effect.Effect; readonly transaction: ( statements: readonly SQLiteStatement[], ) => Effect.Effect; readonly close?: () => void; }