X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fhmysql%2FhSql.mli;h=3c7de40ccb9950a211015ac7e9f099d72dde47e4;hb=ddd6560f4e70ec3306d223738a441d5f1dd3eac9;hp=53600b5bf5ca9c90dbfbf21dd37c1b48ad3382a6;hpb=31d99ae9216eeadfefd74202452748251d4ec275;p=helm.git diff --git a/helm/software/components/hmysql/hSql.mli b/helm/software/components/hmysql/hSql.mli index 53600b5bf..3c7de40cc 100644 --- a/helm/software/components/hmysql/hSql.mli +++ b/helm/software/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 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