* http://helm.cs.unibo.it/
*)
+(* $Id$ *)
+
open MetadataTypes
open Printf
let query_sort =
sprintf "INSERT %s VALUES %s;" (sort_tbl ()) (String.concat "," sort_tuples)
in
- ignore (Mysql.exec dbd query_sort)
+ ignore (HMysql.exec dbd query_sort)
end;
if rel_tuples <> [] then
begin
let query_rel =
sprintf "INSERT %s VALUES %s;" (rel_tbl ()) (String.concat "," rel_tuples)
in
- ignore (Mysql.exec dbd query_rel)
+ ignore (HMysql.exec dbd query_rel)
end;
if obj_tuples <> [] then
begin
let query_obj =
sprintf "INSERT %s VALUES %s;" (obj_tbl ()) (String.concat "," obj_tuples)
in
- ignore (Mysql.exec dbd query_obj)
+ ignore (HMysql.exec dbd query_obj)
end
let insert =
sprintf "INSERT INTO %s VALUES %s" (count_tbl ()) (String.concat "," data)
in
- ignore (Mysql.exec dbd insert)
+ ignore (HMysql.exec dbd insert)
let insert_name ~dbd l =
let data =
let insert =
sprintf "INSERT INTO %s VALUES %s" (name_tbl ()) (String.concat "," data)
in
- ignore (Mysql.exec dbd insert)
+ ignore (HMysql.exec dbd insert)
type columns =
MetadataPp.t list list * MetadataPp.t list list * MetadataPp.t list list
begin
let analyze t = "OPTIMIZE TABLE " ^ t ^ ";" in
List.iter
- (fun table -> ignore (Mysql.exec dbd (analyze table)))
+ (fun table -> ignore (HMysql.exec dbd (analyze table)))
[name_tbl (); rel_tbl (); sort_tbl (); obj_tbl(); count_tbl()]
end
let tables_to_clean =
[sort_tbl; rel_tbl; obj_tbl; name_tbl; count_tbl]
-let clean ~(dbd:Mysql.dbd) =
+let clean ~(dbd:HMysql.dbd) =
let owned_uris = (* list of uris in list-of-columns format *)
let query = sprintf "SELECT source FROM %s" (name_tbl ()) in
- let result = Mysql.exec dbd query in
- let uris = Mysql.map result (fun cols ->
+ let result = HMysql.exec dbd query in
+ let uris = HMysql.map result (fun cols ->
match cols.(0) with
| Some src -> src
| None -> assert false) in
sprintf "DELETE FROM %s WHERE source LIKE \"%s%%\"" (tbl ()) s
in
List.iter
- (fun source_col -> ignore (Mysql.exec dbd (query source_col)))
+ (fun source_col -> ignore (HMysql.exec dbd (query source_col)))
owned_uris
in
List.iter del_from tables_to_clean;
let query tbl =
sprintf "DELETE FROM %s WHERE source LIKE \"%s%%\"" (tbl ()) uri
in
- ignore (Mysql.exec dbd (query tbl))
+ ignore (HMysql.exec dbd (query tbl))
in
List.iter del_from tables_to_clean