diff tests/ascdesc.ur @ 1543:6f046b4bad24

Add antiquote for ORDER BY directions
author Adam Chlipala <adam@chlipala.net>
date Fri, 19 Aug 2011 14:20:24 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/ascdesc.ur	Fri Aug 19 14:20:24 2011 -0400
@@ -0,0 +1,10 @@
+table t : { A : int }
+
+fun sortEm b =
+    queryX1 (SELECT * FROM t ORDER BY t.A {if b then sql_asc else sql_desc})
+    (fn r => <xml>{[r.A]}; </xml>)
+
+fun main () : transaction page = return <xml><body>
+  <a link={sortEm True}>Ascending</a><br/>
+  <a link={sortEm False}>Descending</a>
+</body></xml>