Skip to content

Expose negotiated connection capabilities via conn #22

@matt-beanland

Description

@matt-beanland

After the Bolt handshake, the negotiated capabilities (bolt version, server version, policy) are stored in Bolty.Connection state but are not accessible to callers.

Since this information is already present on the checked-out connection, the natural place to expose it is via the conn passed into a transaction/3 callback or checkout:

Bolty.transaction(Bolt, fn conn ->
  Bolty.connection_info(conn)
  # => %{bolt_version: 5.4, server_version: "Neo4j/5.20.0", policy: %Bolty.Policy{...}}
end)

Including the full Bolty.Policy struct allows callers to inspect fine-grained negotiated behaviour (e.g. datetime encoding) if they want it, while callers that only need bolt_version can ignore the rest. Each caller decides how coupled to the internals they want to be.

For callers that need this information before any transaction, a brief checkout suffices — but that's an edge case best handled with a thin helper on top.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions