package ocsigen-start

Build not yet checked
  1. Overview
  2. Docs
Higher-level library for developing Web and mobile applications with users, registration, notifications, etc

Install

dune-project
 Dependency

Authors

Maintainers

Sources

9.0.0.tar.gz
md5=dfd00a648f0d5f64fcfc893427afc996
sha512=d7c77a9f9b617291ea8c49f4e77fcad8187c39e41d6cb2942ad1c8f45ba620ac261d25a3e75c1b2ce1fd429dad009abb45fab670542e722ab336dc681b99330a

doc/ocsigen-start.server/Os/Core_db/index.html

Module Os.Core_dbSource

This module defines low level functions for database requests.

Sourcemodule PGOCaml : PGOCaml_generic.PGOCAML_GENERIC with type 'a monad = 'a Lwt.t
Sourceval init : ?host:string -> ?port:int -> ?user:string -> ?password:string -> ?database:string -> ?unix_domain_socket_dir:string -> ?pool_size:int -> ?init:(PGOCaml.pa_pg_data PGOCaml.t -> unit Lwt.t) -> unit -> unit

init ?host ?port ?user ?password ?database ?unix_domain_socket_dir ?init () initializes the variables for the database access and register a function init invoked each time a connection is created.

Sourceval full_transaction_block : (PGOCaml.pa_pg_data PGOCaml.t -> 'a Lwt.t) -> 'a Lwt.t

full_transaction_block f executes function f within a database transaction. The argument of f is a PGOCaml database handle.

Sourceval without_transaction : (PGOCaml.pa_pg_data PGOCaml.t -> 'a Lwt.t) -> 'a Lwt.t

without_transaction f executes function f outside a database transaction. The argument of f is a PGOCaml database handle.

Direct access to the connection pool

Sourcetype wrapper = {
  1. f : 'a. PGOCaml.pa_pg_data PGOCaml.t -> (unit -> 'a Lwt.t) -> 'a Lwt.t;
}

Setup a wrapper function which is used each time a connection is acquired. This function can perform some actions before and/or after the connection is used.

Sourceval set_connection_wrapper : wrapper -> unit