view tests/limit.ur @ 1905:cd1cfecc8c72

Remove autogenerated config.h.in from version control Signed-off-by: Anders Kaseorg <andersk@mit.edu> --- .hgignore | 1 + include/urweb/config.h.in | 104 ---------------------------------------------- 2 files changed, 1 insertion(+), 104 deletions(-) delete mode 100644 include/urweb/config.h.in
author Anders Kaseorg <andersk@mit.edu>
date Fri, 22 Nov 2013 09:36:14 -0500
parents 02e1870a0516
children
line wrap: on
line source
table t : {A : int, B : string, C : float}

val q1 = (SELECT * FROM t LIMIT 42)
val q2 = fn n => (SELECT * FROM t LIMIT {n})

val q3 = (SELECT * FROM t OFFSET 3)
val q4 = fn n => fn m => (SELECT * FROM t LIMIT {n} OFFSET {m})


datatype list a = Nil | Cons of a * list a

val r1 : transaction (list {A : int, B : string, C : float}) =
        query (q4 3 7)
        (fn fs acc => return (Cons (fs.T, acc)))
        Nil

val r2 : transaction string =
        ls <- r1;
        return (case ls of
                    Nil => "Problem"
                  | Cons ({B = b, ...}, _) => b)

val main : unit -> transaction page = fn () =>
        s <- r2;
        return <html><body>
                {cdata s}
        </body></html>