Module Sqlgg_stmt_cache.SharedConnectionCacheSource

Parameters

module Impl : Cached_m with type 'a IO.future = 'a MutexImpl.future

Signature

Sourcemodule Stmt_cache : sig ... end
include module type of struct include Stmt_cache end
type statement = Impl.statement
type params = Impl.params
type row = Impl.row
type result = Impl.result
type execute_response = Impl.execute_response = {
  1. affected_rows : int64;
  2. insert_id : int64 option;
}
Sourcemodule Types = Stmt_cache.Types
type num = Types.Int.t
type text = Types.Text.t
type any = Types.Any.t
type datetime = Types.Datetime.t
exception Oops of string
val get_column_Bool : row -> int -> Types.Bool.t
val get_column_Int : row -> int -> Types.Int.t
val get_column_UInt64 : row -> int -> Unsigned.UInt64.t
val get_column_Text : row -> int -> Types.Text.t
val get_column_Any : row -> int -> Types.Any.t
val get_column_Float : row -> int -> Types.Float.t
val get_column_Decimal : row -> int -> Types.Decimal.t
val get_column_Datetime : row -> int -> Types.Datetime.t
val get_column_Json : row -> int -> Types.Json.t
val get_column_Json_path : row -> int -> Types.Json_path.t
val get_column_One_or_all : row -> int -> Types.One_or_all.t
val get_column_Bool_nullable : row -> int -> Types.Bool.t option
val get_column_Int_nullable : row -> int -> Types.Int.t option
val get_column_UInt64_nullable : row -> int -> Unsigned.UInt64.t option
val get_column_Text_nullable : row -> int -> Types.Text.t option
val get_column_Any_nullable : row -> int -> Types.Any.t option
val get_column_Float_nullable : row -> int -> Types.Float.t option
val get_column_Decimal_nullable : row -> int -> Types.Decimal.t option
val get_column_Datetime_nullable : row -> int -> Types.Datetime.t option
val get_column_Json_nullable : row -> int -> Types.Json.t option
val get_column_Json_path_nullable : row -> int -> Types.Json_path.t option
val get_column_One_or_all_nullable : row -> int -> Types.One_or_all.t option
val get_column_bool : row -> int -> bool
val get_column_bool_nullable : row -> int -> bool option
val get_column_int64 : row -> int -> int64
val get_column_int64_nullable : row -> int -> int64 option
val get_column_uint64 : row -> int -> Unsigned.UInt64.t
val get_column_uint64_nullable : row -> int -> Unsigned.UInt64.t option
val get_column_float : row -> int -> float
val get_column_float_nullable : row -> int -> float option
val get_column_decimal : row -> int -> float
val get_column_decimal_nullable : row -> int -> float option
val get_column_datetime : row -> int -> string
val get_column_datetime_nullable : row -> int -> string option
val get_column_string : row -> int -> string
val get_column_string_nullable : row -> int -> string option
val get_column_json : row -> int -> Sqlgg_trait_types.json
val get_column_json_nullable : row -> int -> Sqlgg_trait_types.json option
val get_column_json_path : row -> int -> Sqlgg_trait_types.json_path
val get_column_json_path_nullable : row -> int -> Sqlgg_trait_types.json_path option
val get_column_one_or_all : row -> int -> Sqlgg_trait_types.one_or_all
val get_column_one_or_all_nullable : row -> int -> Sqlgg_trait_types.one_or_all option
val start_params : statement -> int -> params
val set_param_null : params -> unit
val set_param_Text : params -> Types.Text.t -> unit
val set_param_Any : params -> Types.Any.t -> unit
val set_param_Bool : params -> Types.Bool.t -> unit
val set_param_Int : params -> Types.Int.t -> unit
val set_param_UInt64 : params -> Unsigned.UInt64.t -> unit
val set_param_Float : params -> Types.Float.t -> unit
val set_param_Decimal : params -> Types.Decimal.t -> unit
val set_param_Datetime : params -> Types.Datetime.t -> unit
val set_param_Json : params -> Types.Json.t -> unit
val set_param_Json_path : params -> Types.Json_path.t -> unit
val set_param_One_or_all : params -> Types.One_or_all.t -> unit
val set_param_bool : params -> bool -> unit
val set_param_int64 : params -> int64 -> unit
val set_param_uint64 : params -> Unsigned.UInt64.t -> unit
val set_param_float : params -> float -> unit
val set_param_decimal : params -> float -> unit
val set_param_string : params -> string -> unit
val set_param_datetime : params -> float -> unit
val set_param_json : params -> Sqlgg_trait_types.json -> unit
val set_param_json_path : params -> Sqlgg_trait_types.json_path -> unit
val set_param_one_or_all : params -> Sqlgg_trait_types.one_or_all -> unit
Sourcemodule Make_enum = Stmt_cache.Make_enum
val finish_params : params -> result IO.future
val no_params : statement -> result IO.future
val prepare : 'a Impl.connection -> string -> statement IO.future
val close_stmt : statement -> unit IO.future
val select_with_stmt : statement -> (statement -> result IO.future) -> (row -> unit) -> unit IO.future
val select_one_with_stmt : statement -> (statement -> result IO.future) -> (row -> 'a) -> 'a IO.future
val select_one_maybe_with_stmt : statement -> (statement -> result IO.future) -> (row -> 'a) -> 'a option IO.future
val execute_with_stmt : statement -> (statement -> result IO.future) -> execute_response IO.future
Sourcetype cache_entry = Make(Config)(Impl).cache_entry = {
  1. stmt : Impl.statement;
  2. mutable last_use_s : float;
}
Sourcemodule Evict = Stmt_cache.Evict
Sourcetype cache_state = Make(Config)(Impl).cache_state = {
  1. mutable cache : (string, cache_entry) LRU.t;
  2. mutable ops_count : int;
}
Sourceval now_s : unit -> float
Sourceval is_expired : cache_entry -> bool
Sourceval with_prepared_stmt : 'a Make(Config)(Impl).connection -> string -> (Impl.statement -> 'b Impl.IO.future) -> 'b Impl.IO.future
Sourceval reset_metrics : 'a Make(Config)(Impl).connection -> unit
Sourcetype nonrec 'a connection = {
  1. base_conn : 'a Make(Config)(Impl).connection;
  2. mutex : MutexImpl.t;
}
Sourceval create_cached_connection : 'a Impl.connection -> 'a connection
Sourceval select : 'a connection -> string -> (Impl.statement -> Impl.result Impl.IO.future) -> (Impl.row -> unit) -> unit MutexImpl.future
Sourceval select_one : 'a connection -> string -> (Impl.statement -> Impl.result Impl.IO.future) -> (Impl.row -> 'b) -> 'b MutexImpl.future
Sourceval select_one_maybe : 'a connection -> string -> (Impl.statement -> Impl.result Impl.IO.future) -> (Impl.row -> 'b) -> 'b option MutexImpl.future
Sourceval cache_stats : 'a connection -> string
Sourceval clear_cache : 'a connection -> unit MutexImpl.future
Sourceval close_cached_connection : ?close_underlying:??? -> 'a connection -> unit MutexImpl.future