summaryrefslogtreecommitdiff
path: root/lib/top.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-10-30 15:16:37 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-10-30 15:16:37 -0400
commitd710cc7a5aa246763af96dfca57ec8a7a5a6fd37 (patch)
treefe9ae1798baecaadf006b54d792997b0fb2db54c /lib/top.ur
parent5400696e2584c331c6fa6c9627a6c60d08327480 (diff)
Time MIN/MAX
Diffstat (limited to 'lib/top.ur')
-rw-r--r--lib/top.ur8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/top.ur b/lib/top.ur
index 0bc345de..d36af3f3 100644
--- a/lib/top.ur
+++ b/lib/top.ur
@@ -157,3 +157,11 @@ fun oneOrNoRows (tables ::: {{Type}}) (exps ::: {Type})
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)
+