diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-09-11 12:22:06 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-09-11 12:22:06 -0400 |
commit | 549b3c11b75bb08eb6b686d2d1a04bc0ec7647a9 (patch) | |
tree | 50b65dd78d1529f8f39632d2bae04c672e89faa9 /src/prepare.sml | |
parent | 0ee5e278e328dd8bb567932cdb99944d0fbe206f (diff) |
Improve detection of opportunities for prepared statements with bool parameters
Diffstat (limited to 'src/prepare.sml')
-rw-r--r-- | src/prepare.sml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/prepare.sml b/src/prepare.sml index a6b6a4f3..20a09c9b 100644 --- a/src/prepare.sml +++ b/src/prepare.sml @@ -45,6 +45,12 @@ fun prepString (e, ss, n) = SOME ("$" ^ Int.toString (n + 1) ^ "::text" :: ss, n + 1) | EFfiApp ("Basis", "sqlifyBool", [e]) => SOME ("$" ^ Int.toString (n + 1) ^ "::bool" :: ss, n + 1) + | ECase (e, + [((PCon (_, PConFfi {mod = "Basis", con = "True", ...}, _), _), + (EPrim (Prim.String "TRUE"), _)), + ((PCon (_, PConFfi {mod = "Basis", con = "False", ...}, _), _), + (EPrim (Prim.String "FALSE"), _))], + _) => SOME ("$" ^ Int.toString (n + 1) ^ "::bool" :: ss, n + 1) | _ => NONE |