package caqti
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=3ceea06ba0e8e8bcab0386b5817b68cb30fce457eaa25ada0182891d66f6a0b9
sha512=e01f546a45b04cafd5fa262e9228e5a1aabd5e0942059c073a4181c928450baf3d990cc59ffb1a33dff445b46a0e218224a23dca96e8d24cdd0ab793d08e4538
doc/caqti.classic/Caqti_pool_config/index.html
Module Caqti_pool_configSource
include module type of struct include Caqti.Pool.Config end
Construction and Generic Operations
val create :
?max_size:int ->
?max_idle_size:int ->
?max_idle_age:Mtime.Span.t option ->
?max_use_count:int option ->
unit ->
tCreates 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.
The configuration object with no setting, which gives the built-in defaults. Alternatively, use default_from_env for a configuration based on environment variables.
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>.
merge_left cL cR is the configuration cL with missing settings populated by the corresponding present settings from cR.
get key config is the value of key in config or None if unset.
set key value config is config with key set to value regardless of any previous mapping.
Configuration Keys
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.
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.
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.
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.