* http://cs.unibo.it/helm/.
*)
-type flag = Postgres | Galax | Stat | Quiet | Warn | Log
+(* AUTOR: Ferruccio Guidi <fguidi@cs.unibo.it>
+ *)
+
+type connection = MySQL_C of Mysql.dbd
+ | Postgres_C of Postgres.connection
+ | No_C
+
+type flag = Galax | Postgres | Queries | Result | Source | Times | Warn
+
+type handle = {
+ log : string -> unit; (* logging function *)
+ set : flag list; (* options *)
+ pgc : connection; (* PG connection *)
+ pgm : MQIMap.pg_map; (* PG conversion function *)
+ pga : MQIMap.pg_alias (* PG table aliases *)
+}
val string_of_flags : flag list -> string
val flags_of_string : string -> flag list
-type handle
-
-val init : flag list -> (string -> unit) -> handle
+val init : ?flags:(flag list) -> ?log:(string -> unit) -> unit -> handle
val close : handle -> unit
val connected : handle -> bool
+val exec : handle -> (MQITypes.query -> unit) ->
+ MQITypes.table -> MQITypes.columns ->
+ string MQITypes.con_true -> string MQITypes.con_false ->
+ MQITypes.result
-val init_if_connected : flag list -> (string -> unit) -> handle
+val init_if_connected : ?flags:(flag list) -> ?log:(string -> unit) -> unit -> handle
(* The following functions allow to read the handle internal fields.
* For exclusive use of the interpreter.
*)
-val log : handle -> string -> unit
-val set : handle -> flag -> bool
-val pgc : handle -> Postgres.connection option
-val flags : handle -> flag list
+val log : handle -> string -> unit
+val set : handle -> flag -> bool
+val flags : handle -> flag list
+val tables : handle -> MathQL.path -> MQIMap.pg_tables
+val field : handle -> MathQL.path -> string -> string
+val resolve : handle -> string -> string