diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-07-17 17:03:37 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-07-17 17:03:37 -0400 |
commit | 8792a4b892de36b894b44c61e6a991efd9fbe2dc (patch) | |
tree | 81195938120b587d5dfe18fc3907b130b9d18ce2 /src/monoize.sml | |
parent | 6c255756254997d09a47f14b77998d086e8301c2 (diff) |
Most of demo working with SQLite
Diffstat (limited to 'src/monoize.sml')
-rw-r--r-- | src/monoize.sml | 42 |
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 ()) |