summaryrefslogtreecommitdiff
path: root/lib/top.urs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/top.urs')
-rw-r--r--lib/top.urs10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/top.urs b/lib/top.urs
index 22cebb16..6e9dda4e 100644
--- a/lib/top.urs
+++ b/lib/top.urs
@@ -116,3 +116,13 @@ val oneOrNoRows : tables ::: {{Type}} -> exps ::: {Type}
[[nm] ~ acc] =>
[nm = $fields] ++ acc)
[] tables))
+
+val oneRow : tables ::: {{Type}} -> exps ::: {Type}
+ -> sql_query tables exps
+ -> fn [tables ~ exps] =>
+ transaction
+ $(exps
+ ++ fold (fn nm (fields :: {Type}) acc
+ [[nm] ~ acc] =>
+ [nm = $fields] ++ acc)
+ [] tables)