changeset 2245:27899da8780b

Sqlcache allows any expression injected into SQL.
author Ziv Scully <ziv@mit.edu>
date Sun, 02 Aug 2015 18:25:42 -0700
parents e4a7e3cd6f11
children 4769b27aa436
files src/sql.sml
diffstat 1 files changed, 5 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/sql.sml	Mon Jul 20 23:25:44 2015 -0700
+++ b/src/sql.sml	Sun Aug 02 18:25:42 2015 -0700
@@ -305,17 +305,11 @@
 
       | _ => NONE
 
-fun sqlifySqlcache chs =
-    case chs of
-      (* Could have variables or constants as well as FFIs. *)
-        Exp (e as (ERel _, _)) :: chs => SOME (e, chs)
-      (* If it is an FFI, match the entire expression. *)
-      | Exp (e as (EFfiApp ("Basis", f, [(_, _)]), _)) :: chs =>
-        if String.isPrefix "sqlify" f then
-            SOME (e, chs)
-        else
-            NONE
-      | _ => sqlify chs
+(* For sqlcache, we only care that we can do string equality on injected Mono
+   expressions, so accept any expression without modifying it. *)
+val sqlifySqlcache =
+ fn Exp e :: chs => SOME (e, chs)
+  | _ => None
 
 fun constK s = wrap (const s) (fn () => s)