X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=components%2Fhmysql%2FhSql.mli;h=6cfc8865542da846ed8acd777b48ce68df62b811;hb=361e74e8f714a12b22730fe3a303b12b10d4d7b6;hp=23761a2b60f655702fccb10a62f4aa8659e7afab;hpb=15417a6cd2d1ce39afc67d36436864978ec7a8e2;p=helm.git diff --git a/components/hmysql/hSql.mli b/components/hmysql/hSql.mli index 23761a2b6..6cfc88655 100644 --- a/components/hmysql/hSql.mli +++ b/components/hmysql/hSql.mli @@ -23,16 +23,6 @@ * 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 = @@ -43,25 +33,38 @@ 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 du queries, used only in table_creator *) +val fake_db_for_mysql: dbtype -> dbd -val isMysql : bool