neodriver

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.

Features

Documentation

Quickstart

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)))

Packages

The four opam packages, in dependency order:

API reference

The per-package module documentation (each root module re-exports its API):

Modules

The root Neodriver re-exports the whole API: