Neodriver_eio.DriverUser-facing entry point: Driver.connect builds a session from a URI and auth token.
val connect :
?resolver:
(Neodriver_core.Addressing.t ->
(Neodriver_core.Addressing.t list, Neodriver_core.Errors.t) Stdlib.result) ->
?domain_name_resolver:
(string -> (string list, Neodriver_core.Errors.t) Stdlib.result) ->
uri:string ->
auth:Conn.auth ->
?auth_manager:Neodriver_core.Auth_manager.t ->
?user_agent:string ->
?connection_timeout:float ->
?pool_config:Neodriver_core.Config.pool_config ->
[> `Network | `Platform of [> `Generic ] ] Eio.Resource.t ->
Mtime.t Eio.Time.clock_ty Eio.Resource.t ->
Eio.Switch.t ->
(t, Neodriver_core.Errors.t) Stdlib.resultBuild a driver for uri with auth. auth_manager (default Auth_manager.static auth) supplies the tokens: new connections authenticate with its current token and a reused connection is re-authenticated when it rotates. resolver replaces the address lookup for direct bolt:// drivers (each returned address is tried in turn); user_agent defaults to Conn.default_user_agent; connection_timeout (seconds) defaults to 30.0 and bounds each connection attempt and its subsequent reads/writes. pool_config (defaults from Config.default_pool_config: 100 connections, 1h lifetime, 60s acquisition timeout, no liveness check) sizes the pool and its acquisition timeout. Connections are established lazily on first use; for neo4j:// the URI's address is the initial router and routing tables are fetched on demand. The sw switch is captured (it hosts the connection attempts), so it must outlive the returned t.
val session : ?config:Session.config -> t -> Session.tA new session borrowing a connection from the driver's pool (or routing cluster, selected by the session's access_mode/database) on first use and returning it (with a RESET) on close. config defaults to Session.default_config: write access, no database or impersonation, the Python retry defaults.
val acquire :
?mode:Neodriver_core.Config.access_mode ->
t ->
(Conn.t, Neodriver_core.Errors.t) Stdlib.resultA connection for driver-level operations (e.g. verify connectivity); return it with release. For a routed driver this uses the default database and mode (default write access).
Return a connection acquired with acquire to the pool (or cluster).
val supports_session_auth : t -> (bool, Neodriver_core.Errors.t) Stdlib.resultWhether the server supports re-authentication (Bolt >= 5.1), i.e. session-level auth (user switching): connects (see acquire) and checks the negotiated protocol.
val verify_authentication :
t ->
auth:Conn.auth ->
(bool, Neodriver_core.Errors.t) Stdlib.resultVerify auth against the server, like the Python driver's verify_authentication: a read connection for the system database is opened with auth (re-authenticating a reused connection). Returns Ok true when the server accepts it; Ok false when it rejects it with an authentication error (CredentialsExpired, Forbidden, TokenExpired or Unauthorized); any other error (including the missing re-authentication support of Bolt < 5.1) propagates.
val close : t -> unitClose the driver's pool/cluster: idle connections are closed and further acquire/session operations fail. Connections still in use by open sessions are closed (not returned to the pool) when those sessions close.
val get_routing_table :
t ->
database:string option ->
Neodriver_core.Routing_table.t optionThe driver's cached routing table for database (None for a direct bolt:// driver or before the first fetch). Test-support API for the TestKit backend.
val force_routing_table_update :
t ->
database:string option ->
bookmarks:string list ->
(unit, Neodriver_core.Errors.t) Stdlib.resultForce a routing-table refresh for database (test-support API for the TestKit backend; a direct bolt:// driver has no routing table and gets an error).
val connection_pool_metrics : t -> address:string -> int * intThe (in_use, idle) connection counts of the pool for address (the routing cluster's per-address pools; a direct driver ignores the address). Test-support API for the TestKit backend (GetConnectionPoolMetrics).