summaryrefslogtreecommitdiff
path: root/src/cjr_print.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-04-26 10:45:59 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-04-26 10:45:59 -0400
commit7bd2bc26389467f685958601cff2708751764515 (patch)
treed20dcbe8aec266976ec07b31a5e11e75162f4fdf /src/cjr_print.sml
parentbc7a09d702e53faaa882bb7b2591abe68ff5648e (diff)
Reading blobs from the database
Diffstat (limited to 'src/cjr_print.sml')
-rw-r--r--src/cjr_print.sml8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cjr_print.sml b/src/cjr_print.sml
index 3f7ec1e1..1447d9e5 100644
--- a/src/cjr_print.sml
+++ b/src/cjr_print.sml
@@ -434,6 +434,12 @@ fun p_getcol wontLeakStrings env (tAll as (t, loc)) i =
newline,
string "})"],
string ")"]
+
+ | TFfi ("Basis", "blob") => box [string "uw_Basis_stringToBlob_error(ctx, PQgetvalue(res, i, ",
+ string (Int.toString i),
+ string "), PQgetlength(res, i, ",
+ string (Int.toString i),
+ string "))"]
| _ =>
p_unsql wontLeakStrings env tAll
@@ -547,7 +553,7 @@ fun notLeaky env allowHeapAllocated =
| SOME t => nl ok' t) cons
end)
| TFfi ("Basis", "string") => false
- | TFfi ("Basis", "blob") => false
+ | TFfi ("Basis", "blob") => allowHeapAllocated
| TFfi _ => true
| TOption t => allowHeapAllocated andalso nl ok t
in