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
commit4f288849df2bb1a5a1d9d6f6ec9537badd82b6ab (patch)
treed20dcbe8aec266976ec07b31a5e11e75162f4fdf /src/cjr_print.sml
parent38507c697c6b5f277cabc5eb61afff14ea02da07 (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