diff src/urweb.grm @ 1187:ad9829c3c12c

COUNT(col)
author Adam Chlipala <adamc@hcoop.net>
date Tue, 16 Mar 2010 15:54:35 -0400
parents ce56795b2e5f
children b8cfb05c091d
line wrap: on
line diff
--- a/src/urweb.grm	Tue Mar 16 15:39:16 2010 -0400
+++ b/src/urweb.grm	Tue Mar 16 15:54:35 2010 -0400
@@ -1738,6 +1738,15 @@
                                          in
                                              (EVar (["Basis"], "sql_count", Infer), loc)
                                          end)
+       | COUNT LPAREN sqlexp RPAREN     (let
+                                             val loc = s (COUNTleft, RPARENright)
+
+                                             val e = (EVar (["Basis"], "sql_count_col", Infer), loc)
+                                             val e = (EApp ((EVar (["Basis"], "sql_aggregate", Infer), loc),
+                                                            e), loc)
+                                         in
+                                             (EApp (e, sqlexp), loc)
+                                         end)
        | sqlagg LPAREN sqlexp RPAREN    (let
                                              val loc = s (sqlaggleft, RPARENright)