let
fun build (~1, acc) = acc
| build (j, acc) =
- build (j-1, makeValue (F_PQgetvalue.f' (roRes, i, j)) :: acc)
+ build (j-1,
+ if F_PQgetisnull.f' (roRes, i, j) <> 0 then
+ NONE :: acc
+ else
+ makeValue (F_PQgetvalue.f' (roRes, i, j)) :: acc)
in
builder (i+1, f (build (nf-1, []), acc))
end
| xch #"\r" = "\\r"
| xch c = str c
in
- foldl (fn (c, s) => s ^ xch c) "'" (String.explode s) ^ "'"
+ foldl (fn (c, s) => s ^ xch c) "E'" (String.explode s) ^ "'"
end
val stringFromSql = valueOf
fun boolFromSql v = boolFromSql' (valueOf v)
end
-structure PgClient = SqlClient(PgDriver)
\ No newline at end of file
+structure PgClient = SqlClient(PgDriver)