Module Neodriver_core.Config

Configuration records with validated constructors.

Configuration records for the Neo4j driver.

See config.ml for the implementation.

type access_mode =
  1. | Read
  2. | Write
    (*

    Access mode for a session: Read or Write.

    *)
type workspace_config = {
  1. connection_acquisition_timeout : float;
  2. max_transaction_retry_time : float;
  3. initial_retry_delay : float;
  4. retry_delay_multiplier : float;
  5. retry_delay_jitter_factor : float;
  6. fetch_size : int;
  7. database : string option;
  8. impersonated_user : string option;
  9. disable_auto_commit_retries : bool;
}

Session workspace settings: timeouts, retry policy, fetch size and database selection.

type pool_config = {
  1. max_connection_lifetime : float;
  2. liveness_check_timeout : float option;
  3. max_connection_pool_size : int;
  4. connection_timeout : float;
  5. connection_write_timeout : float;
  6. keep_alive : bool;
  7. telemetry_disabled : bool;
}

Connection pool settings.

val default_access_mode : access_mode

Default access mode (Write).

val default_workspace_config : workspace_config

Default workspace configuration.

val default_pool_config : pool_config

Default pool configuration.

val make_workspace_config : ?connection_acquisition_timeout:float -> ?max_transaction_retry_time:float -> ?initial_retry_delay:float -> ?retry_delay_multiplier:float -> ?retry_delay_jitter_factor:float -> ?fetch_size:int -> ?database:string option -> ?impersonated_user:string option -> ?disable_auto_commit_retries:bool -> unit -> (workspace_config, Errors.t) Stdlib.result

Build a workspace_config from the given overrides (defaults from default_workspace_config), validating the numeric settings.

  • returns

    Error (Errors.Configuration_error _) on out-of-range values.

val make_pool_config : ?max_connection_lifetime:float -> ?liveness_check_timeout:float option -> ?max_connection_pool_size:int -> ?connection_timeout:float -> ?connection_write_timeout:float -> ?keep_alive:bool -> ?telemetry_disabled:bool -> unit -> (pool_config, Errors.t) Stdlib.result

Build a pool_config from the given overrides (defaults from default_pool_config), validating the numeric settings.

  • returns

    Error (Errors.Configuration_error _) on out-of-range values.