changeset 306:99e4f39e820d

Scratch that change....
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Sep 2008 14:38:14 -0400
parents 55eedecb6c50
children 52d4c60518d4
files lib/basis.urs src/urweb.grm tests/delete.ur tests/update.ur
diffstat 4 files changed, 9 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lib/basis.urs	Sun Sep 07 14:30:32 2008 -0400
+++ b/lib/basis.urs	Sun Sep 07 14:38:14 2008 -0400
@@ -206,19 +206,19 @@
 val insert : fields ::: {Type}
         -> sql_table fields
         -> $(fold (fn nm (t :: Type) acc => [nm] ~ acc =>
-                [nm = sql_exp [] [] [] t] ++ acc) [] fields)
+                [nm = sql_exp [T = fields] [] [] t] ++ acc) [] fields)
         -> dml
 
-val update : changed :: {Type} -> unchanged ::: {Type} -> changed ~ unchanged
+val update : changed ::: {Type} -> unchanged ::: {Type} -> changed ~ unchanged
+        -> $(fold (fn nm (t :: Type) acc => [nm] ~ acc =>
+                [nm = sql_exp [T = changed ++ unchanged] [] [] t] ++ acc) [] changed)
         -> sql_table (changed ++ unchanged)
-        -> $(fold (fn nm (t :: Type) acc => [nm] ~ acc =>
-                [nm = sql_exp [] [] (changed ++ unchanged) t] ++ acc) [] changed)
-        -> sql_exp [] [] (changed ++ unchanged) bool
+        -> sql_exp [T = changed ++ unchanged] [] [] bool
         -> dml
 
 val delete : fields ::: {Type}
         -> sql_table fields
-        -> sql_exp [] [] fields bool
+        -> sql_exp [T = fields] [] [] bool
         -> dml
 
 
--- a/src/urweb.grm	Sun Sep 07 14:30:32 2008 -0400
+++ b/src/urweb.grm	Sun Sep 07 14:38:14 2008 -0400
@@ -753,12 +753,8 @@
                                              val loc = s (LPARENleft, RPARENright)
 
                                              val e = (EVar (["Basis"], "update"), loc)
-                                             val e = (ECApp (e, (CRecord (map (fn (nm, _) =>
-                                                                                  (nm,
-                                                                                   (CWild (KType, loc), loc)))
-                                                                          fsets), loc)), loc)
+                                             val e = (EApp (e, (ERecord fsets, loc)), loc)
                                              val e = (EApp (e, texp), loc)
-                                             val e = (EApp (e, (ERecord fsets, loc)), loc)
                                          in
                                              (EApp (e, sqlexp), loc)
                                          end)
--- a/tests/delete.ur	Sun Sep 07 14:30:32 2008 -0400
+++ b/tests/delete.ur	Sun Sep 07 14:38:14 2008 -0400
@@ -1,5 +1,5 @@
 table t1 : {A : int, B : string, C : float, D : bool}
 
 fun main () : transaction page =
-        () <- dml (DELETE FROM t1 WHERE A = 5);
+        () <- dml (DELETE FROM t1 WHERE T.A = 5);
         return <html><body>Deleted.</body></html>
--- a/tests/update.ur	Sun Sep 07 14:30:32 2008 -0400
+++ b/tests/update.ur	Sun Sep 07 14:38:14 2008 -0400
@@ -1,5 +1,5 @@
 table t1 : {A : int, B : string, C : float, D : bool}
 
 fun main () : transaction page =
-        () <- dml (UPDATE t1 SET B = '6', C = 7.0 WHERE A = 5);
+        () <- dml (UPDATE t1 SET B = '6', C = 7.0 WHERE T.A = 5);
         return <html><body>Updated.</body></html>