The friendly entry point of the driver: open Neodriver exposes the whole API (the neodriver_packstream, neodriver_core and neodriver_eio packages) under one namespace with short names.
bolt:// and TLS bolt+s:// / bolt+ssc:// connections.Neo4jResult / Summary).Add the driver to your dune project with neodriver and neodriver_eio (and Eio_main to run Eio_main.run). A minimal program that connects and runs a query:
open Neodriver
let () =
Eio_main.run (fun env ->
let net = Eio.Stdenv.net env in
let clock = Eio.Stdenv.mono_clock env in
Eio.Switch.run (fun sw ->
let session =
match
Driver.connect ~uri:"bolt://localhost:7687"
~auth:(Conn.basic_auth ~credentials:"your_password" ())
net clock sw
with
| Ok session -> session
| Error error -> failwith (Errors.to_string error)
in
match Session.run session ~query:"RETURN 1 AS n" ~parameters:[] with
| Ok result -> (
match Neo4jResult.values result with
| Ok [ [ Values.Int n ] ] -> Printf.printf "n = %Ld\n%!" n
| _ -> ())
| Error error -> failwith (Errors.to_string error)))The four opam packages, in dependency order:
neodriver — this aggregator: open Neodriver covers the whole API.neodriver_packstream — PackStream binary serialization.neodriver_core — transport-agnostic core (errors, config, temporal values, hydration).neodriver_eio — the Eio (OCaml 5) backend.The per-package module documentation (each root module re-exports its API):
The root Neodriver re-exports the whole API:
Neodriver.Conn, Neodriver.Transport, Neodriver.Bolt, Neodriver.State;Neodriver.Session, Neodriver.Tx;Neodriver.Neo4jResult, Neodriver.Summary;Neodriver.Driver;Neodriver.Packstream, Neodriver.Errors, Neodriver.Config, Neodriver.Addressing, Neodriver.Temporal, Neodriver.Values, Neodriver.Hydration, Neodriver.Capabilities.