Skip to main content Link Search Menu Expand Document (external link)

LibsqlClient overview

Added in v1.0.0


Table of contents


constructor

make

Signature

export declare const make: (
  options: LibsqlClientConfig
) => Effect.Effect<LibsqlClient, never, Scope.Scope | Reactivity.Reactivity>

Added in v1.0.0

layers

layer

Signature

export declare const layer: (config: LibsqlClientConfig) => Layer.Layer<LibsqlClient | Client.SqlClient, ConfigError>

Added in v1.0.0

layerConfig

Signature

export declare const layerConfig: (
  config: Config.Config.Wrap<LibsqlClientConfig>
) => Layer.Layer<LibsqlClient | Client.SqlClient, ConfigError>

Added in v1.0.0

models

LibsqlClient (interface)

Signature

export interface LibsqlClient extends Client.SqlClient {
  readonly [TypeId]: TypeId
  readonly config: LibsqlClientConfig
}

Added in v1.0.0

LibsqlClientConfig (type alias)

Signature

export type LibsqlClientConfig = LibsqlClientConfig.Full | LibsqlClientConfig.Live

Added in v1.0.0

LibsqlClientConfig (namespace)

Added in v1.0.0

Base (interface)

Signature

export interface Base {
  readonly spanAttributes?: Record<string, unknown> | undefined
  readonly transformResultNames?: ((str: string) => string) | undefined
  readonly transformQueryNames?: ((str: string) => string) | undefined
}

Added in v1.0.0

Full (interface)

Signature

export interface Full extends Base {
  /** The database URL.
   *
   * The client supports `libsql:`, `http:`/`https:`, `ws:`/`wss:` and `file:` URL. For more infomation,
   * please refer to the project README:
   *
   * https://github.com/libsql/libsql-client-ts#supported-urls
   */
  readonly url: string | URL
  /** Authentication token for the database. */
  readonly authToken?: Redacted.Redacted | undefined
  /** Encryption key for the database. */
  readonly encryptionKey?: Redacted.Redacted | undefined
  /** URL of a remote server to synchronize database with. */
  readonly syncUrl?: string | URL | undefined
  /** Sync interval in seconds. */
  readonly syncInterval?: number | undefined
  /** Enables or disables TLS for `libsql:` URLs.
   *
   * By default, `libsql:` URLs use TLS. You can set this option to `false` to disable TLS.
   */
  readonly tls?: boolean | undefined
  /** How to convert SQLite integers to JavaScript values:
   *
   * - `"number"` (default): returns SQLite integers as JavaScript `number`-s (double precision floats).
   * `number` cannot precisely represent integers larger than 2^53-1 in absolute value, so attempting to read
   * larger integers will throw a `RangeError`.
   * - `"bigint"`: returns SQLite integers as JavaScript `bigint`-s (arbitrary precision integers). Bigints can
   * precisely represent all SQLite integers.
   * - `"string"`: returns SQLite integers as strings.
   */
  readonly intMode?: "number" | "bigint" | "string" | undefined
  /** Concurrency limit.
   *
   * By default, the client performs up to 20 concurrent requests. You can set this option to a higher
   * number to increase the concurrency limit or set it to 0 to disable concurrency limits completely.
   */
  readonly concurrency?: number | undefined
}

Added in v1.0.0

Live (interface)

Signature

export interface Live extends Base {
  readonly liveClient: Libsql.Client
}

Added in v1.0.0

tags

LibsqlClient

Signature

export declare const LibsqlClient: any

Added in v1.0.0

type ids

TypeId

Signature

export declare const TypeId: typeof TypeId

Added in v1.0.0

TypeId (type alias)

Signature

export type TypeId = typeof TypeId

Added in v1.0.0