AshNeo4j.BoltyHelper (AshNeo4j v0.9.0)

Copy Markdown View Source

AshNeo4j BoltyHelper

Summary

Functions

The Bolty pool the data layer should use for the current process.

Returns true when the current pool (see current_pool/0) is connected to a Neo4j server that supports Cypher 25 (date-versioned Neo4j ≥ 2025.06).

Cypher 25 support for an explicit pool.

Checks Bolty connectivity

Returns the negotiated %Bolty.Policy{} for the current pool (see current_pool/0), or nil when that pool is not started. Cached per pool in :persistent_term after the first call.

Returns the %Bolty.Policy{} for an explicit pool, or nil when not started.

Starts Bolty, returns :ok or {:error, error}

Starts Bolty with config, returns :ok or {:error, error}

Starts the Bolt6 pool (Neo4j 2026.05, Bolt 6.0). Returns :ok, {:error, error}, or {:error, :not_configured} when no Bolt6 config is present.

Runs fun with the data-layer pool overridden to pool for the current process, restoring the previous value afterwards. Query execution and the policy/0 / cypher25?/0 capability checks all follow the override.

Functions

current_pool()

The Bolty pool the data layer should use for the current process.

Defaults to the primary Bolt pool. Override per-process with with_pool/2 (or by setting :ash_neo4j_pool in the process dictionary) — used to route a test's queries and capability checks to a different Neo4j server (e.g. the Bolt 6.0 / Cypher 25 pool).

cypher25?()

Returns true when the current pool (see current_pool/0) is connected to a Neo4j server that supports Cypher 25 (date-versioned Neo4j ≥ 2025.06).

Derived from the server_version string in Bolty.connection_info/1 and cached per pool in :persistent_term. Once diffo-dev/bolty#47 lands this can be simplified to reading policy().cypher25 directly.

cypher25?(pool)

Cypher 25 support for an explicit pool.

is_connected()

Checks Bolty connectivity

policy()

Returns the negotiated %Bolty.Policy{} for the current pool (see current_pool/0), or nil when that pool is not started. Cached per pool in :persistent_term after the first call.

policy(pool)

Returns the %Bolty.Policy{} for an explicit pool, or nil when not started.

start()

Starts Bolty, returns :ok or {:error, error}

start(config)

Starts Bolty with config, returns :ok or {:error, error}

start_bolt6()

Starts the Bolt6 pool (Neo4j 2026.05, Bolt 6.0). Returns :ok, {:error, error}, or {:error, :not_configured} when no Bolt6 config is present.

with_pool(pool, fun)

Runs fun with the data-layer pool overridden to pool for the current process, restoring the previous value afterwards. Query execution and the policy/0 / cypher25?/0 capability checks all follow the override.