aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-01-02 13:31:59 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-01-02 13:31:59 -0500
commit547adaccb0b29cc02ff89013f84ae6446665144d (patch)
tree8003213999cf3e6ad98db16c29cd135654599d1a /lib
parent869bd80eacff24151b92e496ee6b0cade56d9e59 (diff)
Proper 404 generation
Diffstat (limited to 'lib')
-rw-r--r--lib/ur/top.ur18
-rw-r--r--lib/ur/top.urs10
2 files changed, 27 insertions, 1 deletions
diff --git a/lib/ur/top.ur b/lib/ur/top.ur
index b6f6349a..613f5ec5 100644
--- a/lib/ur/top.ur
+++ b/lib/ur/top.ur
@@ -246,6 +246,24 @@ fun queryX' [tables ::: {{Type}}] [exps ::: {Type}] [ctx ::: {Unit}] [inp ::: {T
return <xml>{acc}{r}</xml>)
<xml/>
+fun queryX1' [nm ::: Name] [fs ::: {Type}] [ctx ::: {Unit}] [inp ::: {Type}]
+ (q : sql_query [nm = fs] [])
+ (f : $fs -> transaction (xml ctx inp [])) =
+ query q
+ (fn fs acc =>
+ r <- f fs.nm;
+ return <xml>{acc}{r}</xml>)
+ <xml/>
+
+fun queryXE' [exps ::: {Type}] [ctx ::: {Unit}] [inp ::: {Type}]
+ (q : sql_query [] exps)
+ (f : $exps -> transaction (xml ctx inp [])) =
+ query q
+ (fn fs acc =>
+ r <- f fs;
+ return <xml>{acc}{r}</xml>)
+ <xml/>
+
fun hasRows [tables ::: {{Type}}] [exps ::: {Type}]
[tables ~ exps]
(q : sql_query tables exps) =
diff --git a/lib/ur/top.urs b/lib/ur/top.urs
index d23b3e01..743669ce 100644
--- a/lib/ur/top.urs
+++ b/lib/ur/top.urs
@@ -148,7 +148,15 @@ val queryX' : tables ::: {{Type}} -> exps ::: {Type} -> ctx ::: {Unit} -> inp ::
-> ($(exps ++ map (fn fields :: {Type} => $fields) tables)
-> transaction (xml ctx inp []))
-> transaction (xml ctx inp [])
-
+val queryX1' : nm ::: Name -> fs ::: {Type} -> ctx ::: {Unit} -> inp ::: {Type}
+ -> sql_query [nm = fs] []
+ -> ($fs -> transaction (xml ctx inp []))
+ -> transaction (xml ctx inp [])
+val queryXE' : exps ::: {Type} -> ctx ::: {Unit} -> inp ::: {Type}
+ -> sql_query [] exps
+ -> ($exps -> transaction (xml ctx inp []))
+ -> transaction (xml ctx inp [])
+
val hasRows : tables ::: {{Type}} -> exps ::: {Type}
-> [tables ~ exps] =>
sql_query tables exps