view 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 source
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>