aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sql.sml
diff options
context:
space:
mode:
authorGravatar Ziv Scully <ziv@mit.edu>2015-08-02 18:25:42 -0700
committerGravatar Ziv Scully <ziv@mit.edu>2015-08-02 18:25:42 -0700
commit68e7308878bd4baac189c9e635c66b194adb9a0e (patch)
tree5816ab1ff95c0f9ce75f64bbd316518b4f3d4a09 /src/sql.sml
parent4ff7cf9503b917dcc8db1de3ba03b513240f7dc8 (diff)
Sqlcache allows any expression injected into SQL.
Diffstat (limited to 'src/sql.sml')
-rw-r--r--src/sql.sml16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/sql.sml b/src/sql.sml
index 27894e3f..a04409a0 100644
--- a/src/sql.sml
+++ b/src/sql.sml
@@ -305,17 +305,11 @@ fun sqlify chs =
| _ => 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)