Elixir client for the dllb multi-model NoSQL database.

Provides a high-level API that delegates to a NimblePool-managed connection pool. Configure the pool in your application config:

config :dllb,
  enabled: true,
  host: "127.0.0.1",
  port: 3009,
  pool_size: 5,
  outcome: :json,
  timeout: 30_000

Usage

{:ok, result} = Dllb.query("SELECT * FROM users")
result = Dllb.query!("SELECT * FROM users")

Summary

Functions

Executes multiple queries in a single pool checkout.

Like batch/1 but raises on the first error encountered.

Executes multiple queries inside a BEGIN BATCH ... END BATCH block.

Executes a query through the connection pool.

Executes a query through the connection pool, raising on error.

Functions

batch(query_strings)

@spec batch([String.t()]) :: [ok: Dllb.Result.t(), error: term()]

Executes multiple queries in a single pool checkout.

Returns a list of {:ok, result} | {:error, reason} in the same order as the input queries. This is significantly faster for bulk operations (e.g. AST ingestion) because it amortises the pool checkout overhead.

batch!(query_strings)

@spec batch!([String.t()]) :: [Dllb.Result.t()]

Like batch/1 but raises on the first error encountered.

Returns a list of result structs on success.

batch_transaction(query_strings)

@spec batch_transaction([String.t()]) :: {:ok, Dllb.Result.t()} | {:error, term()}

Executes multiple queries inside a BEGIN BATCH ... END BATCH block.

All statements run in a single server-side storage transaction, eliminating per-statement write-commit overhead. Returns a single result (not a list).

This is dramatically faster than batch/1 for bulk writes because the server commits only once instead of once per statement.

query(query_string)

@spec query(String.t()) :: {:ok, Dllb.Result.t()} | {:error, term()}

Executes a query through the connection pool.

Returns {:ok, result} or {:error, reason}.

query!(query_string)

@spec query!(String.t()) :: Dllb.Result.t()

Executes a query through the connection pool, raising on error.

Returns the result struct on success or raises Dllb.Error.