Liking cljdoc? Tell your friends :D

hive-datascript.swarm.connection

DataScript connection management for swarm state.

Provides:

  • Global connection atom (thread-safe via DataScript internals)
  • Connection lifecycle (create, get, reset)
  • Shared helper functions (now, gen-id)
DataScript connection management for swarm state.

Provides:
- Global connection atom (thread-safe via DataScript internals)
- Connection lifecycle (create, get, reset)
- Shared helper functions (now, gen-id)
raw docstring

*test-conn*clj

Per-thread override for the global swarm connection. When non-nil, get-conn returns this instead of the global atom. Set through with-test-conn (the :swarm-ds isolation in hive-mcp.isolation-methods) so tests run against a fresh in-memory conn without polluting prod state. Honors axiom 20260122235103-7151cc29.

Per-thread override for the global swarm connection.
When non-nil, get-conn returns this instead of the global atom.
Set through `with-test-conn` (the :swarm-ds isolation in
hive-mcp.isolation-methods) so tests run against a fresh in-memory conn
without polluting prod state. Honors axiom 20260122235103-7151cc29.
sourceraw docstring

create-connclj

(create-conn)

Create a new DataScript connection with swarm schema. Returns the connection (atom wrapper around db).

Create a new DataScript connection with swarm schema.
Returns the connection (atom wrapper around db).
sourceraw docstring

current-test-connclj

(current-test-conn)

This thread's test connection override, or nil.

This thread's test connection override, or nil.
sourceraw docstring

DSConnclj

DataScript connection: atom wrapping a DB, satisfies d/conn?.

DataScript connection: atom wrapping a DB, satisfies d/conn?.
sourceraw docstring

ensure-connclj

(ensure-conn)

Ensure connection exists, return it.

Ensure connection exists, return it.
sourceraw docstring

gen-idclj

(gen-id)
(gen-id prefix)

Generate a unique ID with optional prefix.

Generate a unique ID with optional prefix.
sourceraw docstring

get-connclj

(get-conn)

Get the global swarm connection, creating if needed. Returns test-conn when bound (test isolation override).

Get the global swarm connection, creating if needed.
Returns *test-conn* when bound (test isolation override).
sourceraw docstring

nowclj

(now)

Current timestamp as java.util.Date.

Current timestamp as java.util.Date.
sourceraw docstring

reset-conn!clj

(reset-conn!)

Reset the global connection to empty state.

Reset the global connection to empty state.
sourceraw docstring

with-test-connclj

(with-test-conn test-conn f)

Run (F) with TEST-CONN as this thread's swarm connection.

Run (F) with TEST-CONN as this thread's swarm connection.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close