Mercurial > urweb
diff demo/more/versioned.ur @ 1775:6bc2a8cb3a67
Track whether SQL expressions may use window functions, in preparation for actual window function support
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sat, 02 Jun 2012 15:35:58 -0400 |
parents | 9253765d7724 |
children | 818d4097e2ed |
line wrap: on
line diff
--- a/demo/more/versioned.ur Sat Jun 02 10:54:49 2012 -0400 +++ b/demo/more/versioned.ur Sat Jun 02 15:35:58 2012 -0400 @@ -24,7 +24,7 @@ Eq : eq t} fun keyRecd (r : $(M.key ++ M.data)) = - @map2 [sql_injectable] [ident] [sql_exp [] [] []] + @map2 [sql_injectable] [ident] [sql_exp [] [] [] disallow_window] (fn [t] => @sql_inject) M.keyFolder M.key (r --- M.data) @@ -34,18 +34,18 @@ ({Version = (SQL {[vr]}), When = (SQL CURRENT_TIMESTAMP)} ++ keyRecd r ++ @map2 [dmeta] [ident] - [fn t => sql_exp [] [] [] (option t)] + [fn t => sql_exp [] [] [] disallow_window (option t)] (fn [t] x v => @sql_inject (@sql_option_prim x.Inj) (Some v)) M.dataFolder M.data (r --- M.key))) - fun keyExp (r : $M.key) : sql_exp [T = all] [] [] bool = + fun keyExp (r : $M.key) : sql_exp [T = all] [] [] disallow_window bool = @foldR2 [sql_injectable] [ident] [fn before => after :: {Type} -> [before ~ after] - => sql_exp [T = before ++ after] [] [] bool] + => sql_exp [T = before ++ after] [] [] disallow_window bool] (fn [nm :: Name] [t :: Type] [before :: {Type}] [[nm] ~ before] (inj : sql_injectable t) (v : t) (e : after :: {Type} -> [before ~ after] - => sql_exp [T = before ++ after] [] [] bool) + => sql_exp [T = before ++ after] [] [] disallow_window bool) [after :: {Type}] [[nm = t] ++ before ~ after] => (SQL t.{nm} = {[v]} AND {e [[nm = t] ++ after]})) (fn [after :: {Type}] [[] ~ after] => (SQL TRUE)) @@ -113,7 +113,7 @@ | Some cur => vr <- nextval s; let - val r' = @map3 [dmeta] [ident] [ident] [fn t => sql_exp [] [] [] (option t)] + val r' = @map3 [dmeta] [ident] [ident] [fn t => sql_exp [] [] [] disallow_window (option t)] (fn [t] (meta : dmeta t) old new => @sql_inject (@sql_option_prim meta.Inj) (if @@eq [_] meta.Eq old new then