diff demo/crud.ur @ 471:20fab0e96217

Tree demo working (and other assorted regressions fixed)
author Adam Chlipala <adamc@hcoop.net>
date Thu, 06 Nov 2008 19:43:48 -0500
parents d4a81273d4b1
children 12d163bb856f
line wrap: on
line diff
--- a/demo/crud.ur	Thu Nov 06 18:49:38 2008 -0500
+++ b/demo/crud.ur	Thu Nov 06 19:43:48 2008 -0500
@@ -102,7 +102,7 @@
                                                [[nm] ~ rest] =>
                                fn input col acc => acc ++ {nm = @sql_inject col.Inject (col.Parse input)})
                               {} [M.cols] inputs M.cols
-                     ++ {Id = (SQL {id})}));
+                     ++ {Id = (SQL {[id]})}));
         ls <- list ();
         return <xml><body>
           <p>Inserted with ID {[id]}.</p>
@@ -122,7 +122,7 @@
                                fn input col acc => acc ++ {nm =
                                                            @sql_inject col.Inject (col.Parse input)})
                               {} [M.cols] inputs M.cols)
-                    tab (WHERE T.Id = {id}));
+                    tab (WHERE T.Id = {[id]}));
         ls <- list ();
         return <xml><body>
           <p>Saved!</p>
@@ -131,7 +131,7 @@
         </body></xml>
 
     and upd (id : int) =
-        fso <- oneOrNoRows (SELECT tab.{{mapT2T fstTT M.cols}} FROM tab WHERE tab.Id = {id});
+        fso <- oneOrNoRows (SELECT tab.{{mapT2T fstTT M.cols}} FROM tab WHERE tab.Id = {[id]});
         case fso : (Basis.option {Tab : $(mapT2T fstTT M.cols)}) of
             None => return <xml><body>Not found!</body></xml>
           | Some fs => return <xml><body><form>
@@ -150,7 +150,7 @@
           </form></body></xml>
 
     and delete (id : int) =
-        dml (DELETE FROM tab WHERE Id = {id});
+        dml (DELETE FROM tab WHERE Id = {[id]});
         ls <- list ();
         return <xml><body>
           <p>The deed is done.</p>