comparison src/prepare.sml @ 322:aa89b73d83e4

Improve detection of opportunities for prepared statements with bool parameters
author Adam Chlipala <adamc@hcoop.net>
date Thu, 11 Sep 2008 12:22:06 -0400
parents 04ebfe929a98
children e976b187d73a
comparison
equal deleted inserted replaced
321:cd4cabaf3e52 322:aa89b73d83e4
43 SOME ("$" ^ Int.toString (n + 1) ^ "::float8" :: ss, n + 1) 43 SOME ("$" ^ Int.toString (n + 1) ^ "::float8" :: ss, n + 1)
44 | EFfiApp ("Basis", "sqlifyString", [e]) => 44 | EFfiApp ("Basis", "sqlifyString", [e]) =>
45 SOME ("$" ^ Int.toString (n + 1) ^ "::text" :: ss, n + 1) 45 SOME ("$" ^ Int.toString (n + 1) ^ "::text" :: ss, n + 1)
46 | EFfiApp ("Basis", "sqlifyBool", [e]) => 46 | EFfiApp ("Basis", "sqlifyBool", [e]) =>
47 SOME ("$" ^ Int.toString (n + 1) ^ "::bool" :: ss, n + 1) 47 SOME ("$" ^ Int.toString (n + 1) ^ "::bool" :: ss, n + 1)
48 | ECase (e,
49 [((PCon (_, PConFfi {mod = "Basis", con = "True", ...}, _), _),
50 (EPrim (Prim.String "TRUE"), _)),
51 ((PCon (_, PConFfi {mod = "Basis", con = "False", ...}, _), _),
52 (EPrim (Prim.String "FALSE"), _))],
53 _) => SOME ("$" ^ Int.toString (n + 1) ^ "::bool" :: ss, n + 1)
48 54
49 | _ => NONE 55 | _ => NONE
50 56
51 fun prepExp (e as (_, loc), sns) = 57 fun prepExp (e as (_, loc), sns) =
52 case #1 e of 58 case #1 e of