- "count (" is not valid SQL (at least for MySql).
Replaced with "count("
- binary removed. Tables are now binary by default.
The advantage is that in this way indexes do work.
if col <> "" then
let f s = col ^ " regexp " ^ quote ("^" ^ s ^ "$") in
if pat then "(" ^ iter f " or " v ^ ")"
if col <> "" then
let f s = col ^ " regexp " ^ quote ("^" ^ s ^ "$") in
if pat then "(" ^ iter f " or " v ^ ")"
- else match v with
- | [s] -> "binary " ^ col ^ " = " ^ (quote s)
- | v -> "binary " ^ col ^ " in (" ^ pg_msval v ^ ")"
+ else match v with
+ | [s] -> col ^ " = " ^ (quote s)
+ | v -> col ^ " in (" ^ pg_msval v ^ ")"
else "1"
in
let pg_cons l = iter pg_con " and " l in
else "1"
in
let pg_cons l = iter pg_con " and " l in
| lt, llf -> " where " ^ pg_cons lt ^ " and " ^ pg_cons_not_l llf
in
if cols = [] then
| lt, llf -> " where " ^ pg_cons lt ^ " and " ^ pg_cons_not_l llf
in
if cols = [] then
- let r, q = exec c ("select count (source) from " ^ table ^ pg_where) in
+ let r, q = exec c ("select count(source) from " ^ table ^ pg_where) in
match r with
| [[s]] when int_of_string s > 0 -> [[]], q
match r with
| [[s]] when int_of_string s > 0 -> [[]], q
else
exec c ("select " ^ pg_cols ^ " from " ^ table ^ pg_where ^
" order by " ^ List.hd cols ^ " asc")
else
exec c ("select " ^ pg_cols ^ " from " ^ table ^ pg_where ^
" order by " ^ List.hd cols ^ " asc")
if col <> "" then
let f s = col ^ " ~ " ^ quote ("^" ^ s ^ "$") in
if pat then "(" ^ iter f " or " v ^ ")"
if col <> "" then
let f s = col ^ " ~ " ^ quote ("^" ^ s ^ "$") in
if pat then "(" ^ iter f " or " v ^ ")"
- else match v with
- | [s] -> col ^ " = " ^ (quote s)
- | v -> col ^ " in (" ^ pg_msval v ^ ")"
+ else match v with
+ | [s] -> col ^ " = " ^ (quote s)
+ | v -> col ^ " in (" ^ pg_msval v ^ ")"
else "true"
in
let pg_cons l = iter pg_con " and " l in
else "true"
in
let pg_cons l = iter pg_con " and " l in
| lt, llf -> " where " ^ pg_cons lt ^ " and " ^ pg_cons_not_l llf
in
if cols = [] then
| lt, llf -> " where " ^ pg_cons lt ^ " and " ^ pg_cons_not_l llf
in
if cols = [] then
- let r, q = exec c ("select count (source) from " ^ table ^ pg_where) in
+ let r, q = exec c ("select count(source) from " ^ table ^ pg_where) in
match r with
| [[s]] when int_of_string s > 0 -> [[]], q
match r with
| [[s]] when int_of_string s > 0 -> [[]], q
else
exec c ("select " ^ pg_cols ^ " from " ^ table ^ pg_where ^
" order by " ^ List.hd cols ^ " asc")
else
exec c ("select " ^ pg_cols ^ " from " ^ table ^ pg_where ^
" order by " ^ List.hd cols ^ " asc")