import Database from "better-sqlite3"; import { Config, Context, Effect, Layer } from "effect"; import { type OperationError } from "../errors/index.js"; export interface SqliteOptions { /** File path of the database, or ":memory:" for an in-process database. */ readonly path: string; } declare const Sqlite_base: Context.ServiceClass(operation: string, fn: (db: Database.Database) => A) => Effect.Effect; }>; /** * One better-sqlite3 connection (WAL mode). The docstore, `Entity` and `Table` * all share it. Build it once per process with `Sqlite.layer(...)` and let the * layer's scope close the connection. */ export declare class Sqlite extends Sqlite_base { /** Opens the database at `path`; closed when the layer's scope closes. */ static readonly layer: (options: SqliteOptions) => Layer.Layer; /** * Reads `DB_NAME` (default `docstore.db`) and `DOCKERIZED` (default false) * from the configured `ConfigProvider`; a dockerized process stores the * file under `/data/`. */ static readonly layerConfig: Layer.Layer; /** An in-memory database, for tests. */ static readonly layerMemory: Layer.Layer; } export {};