effect-sql-kysely
Version:
A full-featured integration between `@effect/sql` and `Kysely` that provides type-safe database operations with Effect's powerful error handling and resource management.
14 lines (13 loc) • 674 B
TypeScript
import { Effect } from "effect";
import * as Database from "./Database.js";
import * as Scope from "effect/Scope";
import * as Layer from "effect/Layer";
import * as kysely from "kysely";
export declare const make: <DB, Self>(id: string) => MySql2DatabaseConstructor<DB, Self>;
export interface MySql2DatabaseConstructor<DB, Self> extends Database.CoreDatabaseConstructor<DB, Self> {
readonly layer: <E, R>(options: {
readonly acquire: Effect.Effect<kysely.Kysely<DB>, E, R | Scope.Scope>;
readonly spanAttributes?: ReadonlyArray<readonly [string, string]>;
readonly chunkSize?: number;
}) => Layer.Layer<Self, E, Exclude<R, Scope.Scope>>;
}