From c088dec7eff828276b3e9e8891b7cdc041e65430 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 26 Mar 2009 16:22:34 -0400 Subject: Preliminary work supporting channels in databases --- tests/chat.ur | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/chat.ur (limited to 'tests/chat.ur') diff --git a/tests/chat.ur b/tests/chat.ur new file mode 100644 index 00000000..710d97d4 --- /dev/null +++ b/tests/chat.ur @@ -0,0 +1,36 @@ +sequence s +table t : { Id : int, Title : string, Chan : option (channel string) } + +fun list () = + queryX (SELECT * FROM t) + (fn r => + {[r.T.Id]} {[r.T.Title]} + [delete] + ) + +and delete id = + dml (DELETE FROM t WHERE Id = {[id]}); + main () + +and main () : transaction page = + let + fun create r = + id <- nextval s; + dml (INSERT INTO t (Id, Title, Chan) VALUES ({[id]}, {[r.Title]}, NULL)); + main () + in + ls <- list (); + return + + + {ls} +
ID Title
+ +

New Channel

+ +
+ Title:
+ + +
+ end -- cgit v1.2.3