comparison 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
comparison
equal deleted inserted replaced
1442:204ca664b5d6 1443:19e8e3d556d6
1 table entry : { Id : int, Title : string, Created : time, Author : string,
2 Body : string }
3 PRIMARY KEY Id
4
5 fun list () =
6 rows <- queryX (SELECT * FROM entry)
7 (fn row =>
8 <xml>
9 <div>
10 <h1>{[row.Entry.Title]}</h1><br />
11 <h2>By {[row.Entry.Author]} at {[row.Entry.Created]}</h2>
12 <p>{[row.Entry.Body]}</p>
13 </div>
14 </xml>
15 );
16 return
17 <xml>
18 <head>
19 <title>All Entries</title>
20 </head>
21 <body>
22 <h1>All Entries</h1>
23 {rows}
24 </body>
25 </xml>
26
27 fun main () = return <xml>
28 <head>
29 <title>UrBlog</title>
30 </head>
31
32 <body>
33 <h1>UrBlog</h1>
34 </body>
35 </xml>