diff src/lacweb.grm @ 223:bbe5899a9585

Queries back to working as well as before, after start of refactoring to support grouping
author Adam Chlipala <adamc@hcoop.net>
date Thu, 21 Aug 2008 12:49:29 -0400
parents 36fef91a6bbf
children cb8a68964ebb
line wrap: on
line diff
--- a/src/lacweb.grm	Sat Aug 16 17:50:10 2008 -0400
+++ b/src/lacweb.grm	Thu Aug 21 12:49:29 2008 -0400
@@ -640,12 +640,24 @@
 
                                              val sel = (CRecord sel, loc)
 
+                                             val hopt = (sql_inject (EVar (["Basis"], "True"),
+                                                                     EVar (["Basis"], "sql_bool"),
+                                                                     loc))
+
                                              val e = (EVar (["Basis"], "sql_query"), loc)
-                                             val e = (ECApp (e, sel), loc)
+                                             val _ = [((CName "GroupBy", loc),
+                                                       (ECApp ((EVar (["Basis"], "sql_subset_all"), loc),
+                                                               (CWild (KRecord (KType, loc), loc), loc)), loc)),
+                                                      ((CName "Having", loc),
+                                                       hopt)]
                                              val re = (ERecord [((CName "From", loc),
                                                                  (ERecord tables, loc)),
                                                                 ((CName "Where", loc),
-                                                                 wopt)], loc)
+                                                                 wopt),
+                                                                ((CName "SelectFields", loc),
+                                                                 (ECApp ((EVar (["Basis"], "sql_subset"), loc),
+                                                                         sel), loc))], loc)
+
                                              val e = (EApp (e, re), loc)
                                          in
                                              e