Os.DbSourceThis module defines low level functions for database requests.
include module type of Core_dbval 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 ->
unitinit ?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.
full_transaction_block f executes function f within a database transaction. The argument of f is a PGOCaml database handle.
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
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.
Exception raised when no resource corresponds to the database request.
Exception raised when password do not match.
Exception raised when user has no password.
Exception raised when users attempts to connect with unknown identifier.
Exception raised when user attempts to connect with empty password.
Exception raised when there is an attempt to remove the main email.
Exception raised when the account is not activated.
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.