AshNeo4j.BoltyHelper (AshNeo4j v0.10.1)

Copy Markdown View Source

AshNeo4j BoltyHelper

Summary

Functions

Returns true when the current pool (see current_pool/0) is connected to a Neo4j server with APOC installed (#386) — useful as a deploy/start-up healthcheck before relying on an apoc.* fragment(...).

APOC availability for an explicit pool.

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 the CYPHER 25 language selector (date-versioned Neo4j ≥ 2025.06).

Cypher 25 support for an explicit pool.

Returns true when the current pool (see current_pool/0) is connected to a Neo4j server that supports dynamic labels/types (MATCH (n:$(expr)), -[r:$(expr)]->), which landed in Neo4j 5.26.

Dynamic label/type 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.

Starts the BoltApoc pool (Neo4j 5.x Community + APOC, #386). Returns :ok, {:error, error}, or {:error, :not_configured} when no BoltApoc 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

apoc_available?()

Returns true when the current pool (see current_pool/0) is connected to a Neo4j server with APOC installed (#386) — useful as a deploy/start-up healthcheck before relying on an apoc.* fragment(...).

Unlike cypher25?/0 / dynamic_labels?/0 (negotiated server features), APOC is a plugin, so this introspects the server with SHOW PROCEDURES. Cached in :persistent_term per pool after the first call. false when the pool is not started. Installing APOC is the operator's job — this only reports it.

apoc_available?(pool)

APOC availability for an explicit pool.

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 the CYPHER 25 language selector (date-versioned Neo4j ≥ 2025.06).

Read from the negotiated policy().cypher_25 flag (bolty ≥ 0.2.0); false when the pool is not started.

cypher25?(pool)

Cypher 25 support for an explicit pool.

dynamic_labels?()

Returns true when the current pool (see current_pool/0) is connected to a Neo4j server that supports dynamic labels/types (MATCH (n:$(expr)), -[r:$(expr)]->), which landed in Neo4j 5.26.

This is the server-feature axis, distinct from cypher25?/0: dynamic labels run under plain CYPHER 5 and need no CYPHER 25 selector, so a 5.26 server reports dynamic_labels: true but cypher_25: false. Read from the negotiated policy().dynamic_labels flag (bolty ≥ 0.2.0); false when the pool is not started.

dynamic_labels?(pool)

Dynamic label/type 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.

start_bolt_apoc()

Starts the BoltApoc pool (Neo4j 5.x Community + APOC, #386). Returns :ok, {:error, error}, or {:error, :not_configured} when no BoltApoc 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.