diff options
Diffstat (limited to 'tests/urblog.ur')
-rw-r--r-- | tests/urblog.ur | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/urblog.ur b/tests/urblog.ur new file mode 100644 index 00000000..9e3cc27f --- /dev/null +++ b/tests/urblog.ur @@ -0,0 +1,35 @@ +table entry : { Id : int, Title : string, Created : time, Author : string, +Body : string } + PRIMARY KEY Id + +fun list () = + rows <- queryX (SELECT * FROM entry) + (fn row => + <xml> + <div> + <h1>{[row.Entry.Title]}</h1><br /> + <h2>By {[row.Entry.Author]} at {[row.Entry.Created]}</h2> + <p>{[row.Entry.Body]}</p> + </div> + </xml> + ); + return + <xml> + <head> + <title>All Entries</title> + </head> + <body> + <h1>All Entries</h1> + {rows} + </body> + </xml> + +fun main () = return <xml> + <head> + <title>UrBlog</title> + </head> + + <body> + <h1>UrBlog</h1> + </body> +</xml> |