This is server API (go to client)

Warning: Reason support is experimental. We are looking for beta-tester and contributors.

Module Os_db

module Os_db : sig..end

This module defines low level functions for database requests.

exception No_such_resource

Exception raised when no ressource corresponds to the database request.

exception Main_email_removal_attempt

Exception raised when there is an attempt to remove the main email.

exception Account_not_activated

Exception raised when the account is not activated.

module PGOCaml : PGOCaml_generic.PGOCAML_GENERICwith type 'a monad = 'a Lwt.t

Lwt version of PGOCaml

val 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.

val 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.

val 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.

val connection_pool : unit -> PGOCaml.pa_pg_data PGOCaml.t Lwt_pool.t

Direct access to the connection pool

val pwd_crypt_ref : 
  ((string -> string) * ( -> string -> string -> bool))

pwd_crypt_ref is a reference to (f_crypt, f_check) where

  • f_crypt pwd is used to encrypt the password pwd.
  • f_check userid pwd hashed_pwd returns true if the hash of pwd and the hashed password hashed_pwd of the user with id userid match. If they don't match, it returns false.
module Email : sig..end

This module is used for low-level email management with database.

module User : sig..end

This module is used for low-level user management with database.

module Groups : sig..end

This module is low-level and used to manage groups of user.

module Phone : sig..end

Manage user phone numbers