summaryrefslogtreecommitdiff
path: root/src/monoize.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-07-17 17:03:37 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-07-17 17:03:37 -0400
commit7ad34807bd19c3ad0c84a30401c1fafc37e59775 (patch)
tree81195938120b587d5dfe18fc3907b130b9d18ce2 /src/monoize.sml
parent0c42fe7e8be44f7314e53259c33f6e45fe3078d9 (diff)
Most of demo working with SQLite
Diffstat (limited to 'src/monoize.sml')
-rw-r--r--src/monoize.sml42
1 files changed, 29 insertions, 13 deletions
diff --git a/src/monoize.sml b/src/monoize.sml
index 2e9886dd..37df70d1 100644
--- a/src/monoize.sml
+++ b/src/monoize.sml
@@ -1606,19 +1606,35 @@ fun monoExp (env, st, fm) (all as (e, loc)) =
((L'.EAbs ("fs", rt, (L'.TFun (s, (L'.TFun (s, s), loc)), loc),
(L'.EAbs ("tab", s, (L'.TFun (s, s), loc),
(L'.EAbs ("e", s, s,
- strcat [sc "UPDATE ",
- (L'.ERel 1, loc),
- sc " AS T SET ",
- strcatComma (map (fn (x, _) =>
- strcat [sc ("uw_" ^ x
- ^ " = "),
- (L'.EField
- ((L'.ERel 2,
- loc),
- x), loc)])
- changed),
- sc " WHERE ",
- (L'.ERel 0, loc)]), loc)), loc)), loc),
+ if #supportsUpdateAs (Settings.currentDbms ()) then
+ strcat [sc "UPDATE ",
+ (L'.ERel 1, loc),
+ sc " AS T SET ",
+ strcatComma (map (fn (x, _) =>
+ strcat [sc ("uw_" ^ x
+ ^ " = "),
+ (L'.EField
+ ((L'.ERel 2,
+ loc),
+ x), loc)])
+ changed),
+ sc " WHERE ",
+ (L'.ERel 0, loc)]
+ else
+ strcat [sc "UPDATE ",
+ (L'.ERel 1, loc),
+ sc " SET ",
+ strcatComma (map (fn (x, _) =>
+ strcat [sc ("uw_" ^ x
+ ^ " = "),
+ (L'.EField
+ ((L'.ERel 2,
+ loc),
+ x), loc)])
+ changed),
+ sc " WHERE ",
+ (L'.EFfiApp ("Basis", "unAs", [(L'.ERel 0, loc)]), loc)]),
+ loc)), loc)), loc),
fm)
end
| _ => poly ())