comparison src/mono_opt.sml @ 281:7d5860add50f

Change sqlify[int|float|string] to annotate with SQL types
author Adam Chlipala <adamc@hcoop.net>
date Thu, 04 Sep 2008 10:27:21 -0400
parents d1b679dbbc25
children ffe5b01908ae
comparison
equal deleted inserted replaced
280:fdd7a698be01 281:7d5860add50f
79 str ch 79 str ch
80 else 80 else
81 "%" ^ hexIt ch) 81 "%" ^ hexIt ch)
82 82
83 83
84 val sqlifyInt = attrifyInt 84 fun sqlifyInt n = attrifyInt n ^ "::int8"
85 val sqlifyFloat = attrifyFloat 85 fun sqlifyFloat n = attrifyFloat n ^ "::float8"
86 86
87 fun sqlifyString s = "E'" ^ String.translate (fn #"'" => "\\'" 87 fun sqlifyString s = "E'" ^ String.translate (fn #"'" => "\\'"
88 | ch => str ch) 88 | ch => str ch)
89 (String.toString s) ^ "'" 89 (String.toString s) ^ "'::text"
90 90
91 fun exp e = 91 fun exp e =
92 case e of 92 case e of
93 EPrim (Prim.String s) => 93 EPrim (Prim.String s) =>
94 let 94 let