let exec c q =
let g = function None -> "" | Some v -> v in
let f a = List.map g (Array.to_list a) in
+prerr_endline ("###\n" ^ q);
Mysql.map ~f:f (Mysql.exec c q), q
let exec c table cols ct cfl =
else "1"
in
let pg_cons l = iter pg_con " and " l in
- let pg_cons_not l = "not (" ^ pg_cons l ^ ")" in
+ let pg_cons_not l =
+ match l with [] -> "1" | _ -> "not (" ^ pg_cons l ^ ")" in
let pg_cons_not_l ll = iter pg_cons_not " and " ll in
let pg_where = match ct, cfl with
| [], [] -> ""
else "true"
in
let pg_cons l = iter pg_con " and " l in
- let pg_cons_not l = "not (" ^ pg_cons l ^ ")" in
+ let pg_cons_not l =
+ match l with [] -> "true" | _ -> "not (" ^ pg_cons l ^ ")" in
let pg_cons_not_l ll = iter pg_cons_not " and " ll in
let pg_where = match ct, cfl with
| [], [] -> ""