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. max_transaction_retry_time : float;
  2. initial_retry_delay : float;
  3. retry_delay_multiplier : float;
  4. retry_delay_jitter_factor : float;
  5. fetch_size : int;
  6. database : string option;
  7. impersonated_user : string option;
  8. disable_auto_commit_retries : bool;
}

Session workspace settings: 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_acquisition_timeout : float;
  5. connection_timeout : float;
  6. connection_write_timeout : float;
  7. keep_alive : bool;
  8. telemetry_disabled : bool;
  9. notifications_min_severity : string option;
  10. notifications_disabled_categories : string list option;
  11. home_db_cache_ttl : float;
}

Connection pool settings. home_db_cache_ttl is how long a routed driver remembers a resolved home database (default Float.infinity, i.e. the cache is on — a default-database session guesses the cached home database only when a server-side-routing capable connection has been seen); a TTL <= 0.0 disables the cache and every default-database session re-fetches the home database over ROUTE. notifications_min_severity and notifications_disabled_categories are the driver-level notification filtering settings sent in HELLO (Bolt >= 5.2; None omits the field, Some [] sends an empty category list).

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 : ?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_acquisition_timeout:float -> ?connection_timeout:float -> ?connection_write_timeout:float -> ?keep_alive:bool -> ?telemetry_disabled:bool -> ?notifications_min_severity:string option -> ?notifications_disabled_categories:string list option -> ?home_db_cache_ttl:float -> 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.