Arcadic.Conn (Arcadic v0.1.0)

Copy Markdown View Source

Connection handle for ArcadeDB — pure data, no process.

HTTP has no per-connection state; Finch owns the socket pool and the ArcadeDB session (when inside a transaction) rides session_id. Build one with Arcadic.connect/3; derive a same-pool handle on another database with with_database/2.

Summary

Functions

Build a connection handle.

Derive a same-pool handle on another database; validates and clears the session.

Types

t()

@type t() :: %Arcadic.Conn{
  auth: {String.t(), String.t()},
  base_url: String.t(),
  database: String.t(),
  session_id: String.t() | nil,
  timeout: pos_integer() | nil,
  transport: module(),
  transport_options: keyword()
}

Functions

new(base_url, database, opts \\ [])

@spec new(String.t(), String.t(), keyword()) :: t()

Build a connection handle.

Options

  • :auth{user, pass}. REQUIRED (no default credential).
  • :transport — transport module (default Arcadic.Transport.HTTP).
  • :transport_options — keyword passed to the transport (:finch, :plug, :timeout, pool knobs).
  • :timeout — default per-call receive timeout (ms).

with_database(conn, database)

@spec with_database(t(), String.t()) :: t()

Derive a same-pool handle on another database; validates and clears the session.