summaryrefslogtreecommitdiff
path: root/lib/top.ur
diff options
context:
space:
mode:
Diffstat (limited to 'lib/top.ur')
-rw-r--r--lib/top.ur6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/top.ur b/lib/top.ur
index 15f2a732..990a18fa 100644
--- a/lib/top.ur
+++ b/lib/top.ur
@@ -103,3 +103,9 @@ fun queryX (tables ::: {{Type}}) (exps ::: {Type}) (ctx ::: {Unit}) (q : sql_que
query q
(fn fs acc => return <xml>{acc}{f fs}</xml>)
<xml></xml>
+
+fun oneOrNoRows (tables ::: {{Type}}) (exps ::: {Type}) (q : sql_query tables exps) =
+ [tables ~ exps] =>
+ query q
+ (fn fs _ => return (Some fs))
+ None