summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-10-06 13:11:03 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-10-06 13:11:03 -0400
commit1de883737e14d5b6dbd442c5f92ca6e97d9322b5 (patch)
tree0678ebf96e02863f7ab6dc5eea1adf7d4c3bb127 /demo
parent140bf664ca2e8e0f38650226d025eab952d93b9e (diff)
Finalized Orm1 demo
Diffstat (limited to 'demo')
-rw-r--r--demo/more/orm1.ur14
-rw-r--r--demo/more/orm1.urp4
-rw-r--r--demo/more/prose6
3 files changed, 18 insertions, 6 deletions
diff --git a/demo/more/orm1.ur b/demo/more/orm1.ur
index bdf6ef8c..bbbe2b00 100644
--- a/demo/more/orm1.ur
+++ b/demo/more/orm1.ur
@@ -11,10 +11,12 @@ structure S = Table(struct
end)
fun action () =
- r <- T.create {A = 3, B = "Hi"};
- T.save (r -- #B ++ {B = "Bye"});
+ r1 <- T.create {A = 3, B = "Hi"};
+ T.save (r1 -- #B ++ {B = "Bye"});
+ r2 <- T.create {A = 4, B = "Why"};
+ r3 <- T.create {A = 66, B = "Hi"};
- s <- S.create {C = r.Id, D = 45.67};
+ s <- S.create {C = r1.Id, D = 45.67};
ls <- T.list;
ls' <- T.search (T.eq T.cols.B.Col "Hi");
@@ -22,6 +24,12 @@ fun action () =
lsS <- S.list;
lsS <- List.mapM (fn r => p <- S.cols.C.Parent r; return (r, p)) lsS;
+ T.delete r1;
+ T.delete r2;
+ T.delete r3;
+
+ S.delete s;
+
return <xml><body>
{List.mapX (fn r => <xml><li> {[r.A]}: {[r.B]}</li></xml>) ls}
<br/>
diff --git a/demo/more/orm1.urp b/demo/more/orm1.urp
index 96d1a6e7..450f57a8 100644
--- a/demo/more/orm1.urp
+++ b/demo/more/orm1.urp
@@ -1,6 +1,6 @@
library orm
-database dbname=orm1
-sql orm1.sql
+database dbname=test
+sql test.sql
$/list
orm1
diff --git a/demo/more/prose b/demo/more/prose
index c2a3d281..a2765778 100644
--- a/demo/more/prose
+++ b/demo/more/prose
@@ -2,6 +2,10 @@
dragList.urp
-This is an Ur/Web version of the "draggable lists" <a href="http://groups.inf.ed.ac.uk/links/examples/">demo program from Links</a>.
+<p>This is an Ur/Web version of the "draggable lists" <a href="http://groups.inf.ed.ac.uk/links/examples/">demo program from Links</a>.</p>
grid1.urp
+
+orm1.urp
+
+<p>Many varieties of "object-relational mapping" (ORM) can be implemented as libraries in Ur/Web, as this demo shows.</p>