Plasma GitLab Archive
Projects Blog Knowledge

Module Pfs_db

module Pfs_db: sig .. end
Utility functions for database accesses

class type db_config = object .. end
val dummy_db_config : unit -> db_config
val extract_db_config : Netplex_types.config_file -> db_config
Extracts the db_config from this Netplex config file:

         netplex {
           ...
           database {
             dbname = "<name of database>";  (* required *)
             host = "<hostname>";
             hostaddr = "<ipaddr>";
             port = <port>;
             user = "<user name>";
             password = "<password>";
             ro_connections_max = <c>;
           };
           ...
         }
      

See the documentation of PostgreSQL for dbname, host, hostaddr, port, user, and password (but it should be obvious).

ro_connections_max is the number of db connections dedicated for read-only database accesses. Defaults to 20.

class type ['mode] async_connection = object .. end
type read_write = [ `R | `W ] 
the mode that is conventionally used for read-write connections
type read_only = [ `R ] 
the mode that is conventionally used for read-only connections
type rw_async_connection = read_write async_connection 
abbrev
type ro_async_connection = read_only async_connection 
abbrev
class ['mode] connect : db_config -> ['mode] async_connection
Right now, we only have a sync connect
class async_exec : 'mode async_connection -> Unixqueue.event_system -> ?expect:Postgresql.result_status list -> ?params:string array -> ?binary_params:bool array -> ?copy_in_lines:string list -> ?noprepare:bool -> string -> [Postgresql.result] Uq_engines.engine
Execution as an engine.
This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml