diff lib/top.ur @ 440:19d7f79cd584

Time MIN/MAX
author Adam Chlipala <adamc@hcoop.net>
date Thu, 30 Oct 2008 15:16:37 -0400
parents 0ce90d4d9ae7
children dfc8c991abd0
line wrap: on
line diff
--- a/lib/top.ur	Thu Oct 30 15:11:37 2008 -0400
+++ b/lib/top.ur	Thu Oct 30 15:16:37 2008 -0400
@@ -157,3 +157,11 @@
     query q
           (fn fs _ => return (Some fs))
           None
+
+fun oneRow (tables ::: {{Type}}) (exps ::: {Type})
+                (q : sql_query tables exps) [tables ~ exps] =
+    o <- oneOrNoRows q;
+    return (case o of
+                None => error <xml>Query returned no rows</xml>
+              | Some r => r)
+