Mercurial > urweb
diff tests/urblog.ur @ 1443:19e8e3d556d6
Fix MySQL time handling
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sun, 27 Mar 2011 15:06:02 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/urblog.ur Sun Mar 27 15:06:02 2011 -0400 @@ -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>