* http://cs.unibo.it/helm/.
*)
-(**
- * {2 Proxy module around MySQL conection}
- *
- * The behaviour of this module is influenced by the Helm_registry boolean value
- * of the "db.nodb" key. When set to "false" the module works as expected. When
- * set to "true" all functions perform dummy action: connect and disconnect do
- * nothing; exec, iter, and map work like the empty set of results has been
- * returned; errno and status return Mysql.Connection_error
- *)
-
type dbd
type result
type error_code =
| No_such_index
| Bad_table_error
| GENERIC_ERROR of string
-exception Error
+
+exception Error of string
(* the exceptions raised are from the Mysql module *)
-val quick_connect :
- ?host:string ->
- ?database:string ->
- ?port:int -> ?password:string -> ?user:string -> unit -> dbd
+type dbtype = User | Library | Legacy
+
+ (* host port dbname user password type *)
+type dbspec
+
+val mk_dbspec :
+ (string * int option * string * string * string option * dbtype) list ->
+ dbspec
+
+val quick_connect : dbspec -> dbd
val disconnect : dbd -> unit
-val exec: dbd -> string -> result
+val exec: dbtype -> dbd -> string -> result
val map : result -> f:(string option array -> 'a) -> 'a list
val iter : result -> f:(string option array -> unit) -> unit
-val errno : dbd -> error_code
+val errno : dbtype -> dbd -> error_code
(* val status : dbd -> Mysql.status *)
-val escape: string -> string
+val escape: dbtype -> dbd -> string -> string
+
+val escape_string_for_like: dbtype -> dbd -> ('a,'b,'c,'a) format4
+
+val isMysql : dbtype -> dbd -> bool
+
+(* this dbd can't do queries, used only in table_creator *)
+val fake_db_for_mysql: dbtype -> dbd
-val isMysql : bool