/** * CR-SQLite compatible Sqlite client tag and type. * * This augments the base `@effect/sql` `SqlClient` with the SQLite-specific * ability to `loadExtension`, which CR-SQLite requires to activate its * functionality on a connection. * * Implementations are provided by platform drivers such as * `@effect/sql-sqlite-node` and `@effect/sql-sqlite-bun`, which already expose * a `loadExtension` method. This tag allows CR-SQLite helpers to depend on the * minimal capability needed across platforms. * * @since 0.1.0 */ import * as SqlClient from "@effect/sql/SqlClient"; import type { SqlError } from "@effect/sql/SqlError"; import { Effect } from "effect"; import * as Context from "effect/Context"; import * as Layer from "effect/Layer"; /** * Extends the generic `SqlClient` with SQLite's `loadExtension` capability. * * @since 0.1.0 */ export interface SqliteClient extends SqlClient.SqlClient { /** * Loads a SQLite extension from a full filesystem path. * * Required to enable CR-SQLite (crsqlite) for the current connection. */ readonly loadExtension: (path: string) => Effect.Effect; } /** * Tag for a CR-SQLite compatible SQLite client. * * @since 0.1.0 */ export declare const SqliteClient: Context.Tag; declare const SqliteClientError_base: new = {}>(args: import("effect/Types").Equals extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & { readonly _tag: "SqliteClientError"; } & Readonly; /** * Error raised when a base `SqlClient` does not support `loadExtension`. * * @since 0.1.0 */ export declare class SqliteClientError extends SqliteClientError_base<{ cause: unknown; }> { } /** * Loads a SQLite extension (e.g., CR‑SQLite) on the current connection. * * @since 0.1.0 */ export declare const loadExtension: (path: string) => Effect.Effect; /** * Validates a base `SqlClient` supports `loadExtension` and narrows it to `SqliteClient`. * * @since 0.1.0 */ export declare const fromSqlClient: (sql: SqliteClient | SqlClient.SqlClient) => Effect.Effect; /** * Provides a `SqliteClient` instance into the environment. * * @since 0.1.0 */ export declare const layer: (sql: SqliteClient) => Layer.Layer; /** * Lifts a base `SqlClient` into a `SqliteClient` if it exposes `loadExtension`. * * @since 0.1.0 */ export declare const layerFromSqlClient: (sql: SqlClient.SqlClient | SqliteClient) => Layer.Layer; export {}; //# sourceMappingURL=SqliteClient.d.ts.map