| 1 | import * as Context from "effect/Context"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | |
| 4 | import type { SQLiteConnection } from "./SQLiteConnection.ts"; |
| 5 | import type { SQLiteErrorType } from "./SQLiteError.ts"; |
| 6 | |
| 7 | export class SQLite extends Context.Service<SQLite, SQLiteService>()( |
| 8 | "SQLite", |
| 9 | ) {} |
| 10 | |
| 11 | /** |
| 12 | * SQLite service that provides database connection factory. |
| 13 | */ |
| 14 | export interface SQLiteService { |
| 15 | /** |
| 16 | * Open a SQLite database at the given path. |
| 17 | */ |
| 18 | open(path: string): Effect.Effect<SQLiteConnection, SQLiteErrorType>; |
| 19 | } |