package caqti

All checked builds pass
  1. Overview
  2. Docs
Unified interface to relational database libraries

Install

dune-project
 Dependency

Authors

Maintainers

Sources

caqti-v3.1.0.tbz
sha256=43cfd7d41627be269449d1f17c4962876d2b383d12fe8c0574e0e07aa3d95243
sha512=b46dcf9e7c012aeefa80f143c840c80d7acd6bb30cd1657486d1adfe345d3570078667caeed728865905c9afd73083ffb1b6983cad7f7ef30e35550506c94c22

doc/caqti/Caqti/Pool/Config/index.html

Module Pool.ConfigSource

Sourcetype _ key
Sourcetype t

Construction and Generic Operations

Sourceval create : ?max_size:int -> ?max_idle_size:int -> ?max_idle_age:Mtime.Span.t option -> ?max_use_count:int option -> unit -> t

Creates a configuration for the implementation of Caqti.Pool.S. The main arguments populate the configuration with the corresponding settings, which are explaind in Configuration Keys.

Sourceval default : t

The configuration object with no setting, which gives the built-in defaults. Alternatively, use default_from_env for a configuration based on environment variables.

Sourceval default_from_env : unit -> t

default_from_env () is a configuration constructed from environment variables of the form CAQTI_POOL_<suffix>, with the upper-cased names of the configuration keys substituted for <suffix>.

Sourceval merge_left : t -> t -> t

merge_left cL cR is the configuration cL with missing settings populated by the corresponding present settings from cR.

Sourceval get : 'a key -> t -> 'a option

get key config is the value of key in config or None if unset.

Sourceval set : 'a key -> 'a -> t -> t

set key value config is config with key set to value regardless of any previous mapping.

Sourceval unset : 'a key -> t -> t

unset key config is config without its mapping for key if any.

Configuration Keys

Sourceval max_size : int key

The maximum number of open connections associated with the pool. When this limit is hit, an attempt to use the pool will block until a connection becomes available. The value must be at least one. If the selected driver does not support concurrent connections, the value 1 is assumed.

Sourceval max_idle_size : int key

The maximum number of idle connections to put into the pool for reuse. Must be between 0 and max_size. If you set this, you must also ensure max_size is set so that the combination is valid. Defaults to max_size. For drivers which does not support concurrent connections, the value will clipped to a maximum of 1.

Sourceval max_idle_age : Mtime.Span.t option key

The maximum age of idle connections before they are scheduled to be disconnected and removed from the pool, or None for no limit. Where possible, a timer will be used to trigger the cleanup. For the caqti.blocking library, the cleanup will only be done opportunistically when the pool is used.

Sourceval max_use_count : int option key

The maximum number of times a pooled connection is reused, or None for no limit. The default is currently 100, but may be changed in the future based on real-world experience. The reason this setting was introduced is that we have seen state being retained on the server side.