LibsqlClient unstable
libSQL adapter for Effect SQL, backed by @libsql/client.
This module provides a LibsqlClient and the generic SQL client
service for @libsql/client. It uses Effect SQL's SQLite compiler, supports
managed SDK clients or caller-owned live clients, classifies libSQL and
SQLite failures as SqlErrors, provides transaction support with
savepoints, and sends SqlClient.batch as one libSQL batch. Streaming
queries are not implemented by this driver.
Constructors
Creates a scoped libSQL SQL client with transaction support. When given connection options it creates and closes the SDK client; when given liveClient, the caller retains ownership.
Signature
declare function make(options: LibsqlClientConfig): Effect<LibsqlClient & SqlClient, never, Scope | Reactivity>Layers
Creates a layer from a concrete libSQL client configuration, providing both LibsqlClient and SqlClient.
Signature
declare function layer(config: LibsqlClientConfig): Layer<LibsqlClient | SqlClient>layerConfig
unstableCreates a layer from a Config-wrapped libSQL client configuration, providing both LibsqlClient and SqlClient.
Signature
declare const layerConfig: (config: Config.Wrap<LibsqlClientConfig>) => Layer.Layer<LibsqlClient | Client.SqlClient, Config.ConfigError>Models
Configuration for a libSQL client, either by supplying connection options or an existing live libSQL client.
Signature
type LibsqlClientConfig = LibsqlClientConfig.Full | LibsqlClientConfig.LiveOther
LibsqlClientConfig
unstableNamespace containing the configuration variants for LibsqlClient.
Services
LibsqlClient
unstableService tag for the libSQL client service.
When to use
Use to access or provide a libSQL client through the Effect context.
Signature
declare const LibsqlClient: Service<LibsqlClient, LibsqlClient & SqlClient>libSQL-backed SQL client service, extending SqlClient with its runtime type marker and client configuration.
Signature
interface LibsqlClient extends Base { readonly "~@effect/sql-libsql/LibsqlClient": "~@effect/sql-libsql/LibsqlClient"; readonly config: LibsqlClientConfig;}