diff tests/tryDml.ur @ 1293:acabf3935060

tryDml
author Adam Chlipala <adam@chlipala.net>
date Sun, 05 Sep 2010 14:00:57 -0400
parents
children 929981850d9d
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/tryDml.ur	Sun Sep 05 14:00:57 2010 -0400
@@ -0,0 +1,13 @@
+table t : {Id : int}
+  PRIMARY KEY Id
+
+fun doStuff () =
+    dml (INSERT INTO t (Id) VALUES (0));
+    o1 <- tryDml (INSERT INTO t (Id) VALUES (0));
+    dml (INSERT INTO t (Id) VALUES (1));
+    o2 <- tryDml (INSERT INTO t (Id) VALUES (1));
+    return <xml>{[o1]}; {[o2]}</xml>
+
+fun main () = return <xml><body>
+  <form> <submit action={doStuff}/> </form>
+</body></xml>