diff lib/ur/list.ur @ 1394:d328983dc5a6

Allow subqueries to reference aggregate-only columns of free tables; treat non-COUNT aggregate functions as possibly returning NULL
author Adam Chlipala <adam@chlipala.net>
date Sat, 15 Jan 2011 14:53:13 -0500
parents 9e0fa4f6ac93
children 3061d1bf4b2d
line wrap: on
line diff
--- a/lib/ur/list.ur	Thu Jan 13 18:15:04 2011 -0500
+++ b/lib/ur/list.ur	Sat Jan 15 14:53:13 2011 -0500
@@ -254,7 +254,7 @@
     end
 
 fun mapQuery [tables ::: {{Type}}] [exps ::: {Type}] [t ::: Type]
-             [tables ~ exps] (q : sql_query [] tables exps)
+             [tables ~ exps] (q : sql_query [] [] tables exps)
              (f : $(exps ++ map (fn fields :: {Type} => $fields) tables) -> t) =
     ls <- query q
                 (fn fs acc => return (f fs :: acc))
@@ -262,7 +262,7 @@
     return (rev ls)
 
 fun mapQueryM [tables ::: {{Type}}] [exps ::: {Type}] [t ::: Type]
-             [tables ~ exps] (q : sql_query [] tables exps)
+             [tables ~ exps] (q : sql_query [] [] tables exps)
              (f : $(exps ++ map (fn fields :: {Type} => $fields) tables) -> transaction t) =
     ls <- query q
                 (fn fs acc => v <- f fs; return (v :: acc))
@@ -270,7 +270,7 @@
     return (rev ls)
 
 fun mapQueryPartialM [tables ::: {{Type}}] [exps ::: {Type}] [t ::: Type]
-             [tables ~ exps] (q : sql_query [] tables exps)
+             [tables ~ exps] (q : sql_query [] [] tables exps)
              (f : $(exps ++ map (fn fields :: {Type} => $fields) tables) -> transaction (option t)) =
     ls <- query q
                 (fn fs acc => v <- f fs;