annotate tests/order_by.ur @ 1739:c414850f206f

Add support for -boot flag, which allows in-tree execution of Ur/Web The boot flag rewrites most hardcoded paths to point to the build directory, and also forces static compilation. This is convenient for developing Ur/Web, or if you cannot 'sudo make install' Ur/Web. The following changes were made: * Header files were moved to include/urweb instead of include; this lets FFI users point their C_INCLUDE_PATH at this directory at write <urweb/urweb.h>. For internal Ur/Web executables, we simply pass -I$PATH/include/urweb as normal. * Differentiate between LIB and SRCLIB; SRCLIB is Ur and JavaScript source files, while LIB is compiled products from libtool. For in-tree compilation these live in different places. * No longer reference Config for paths; instead use Settings; these settings can be changed dynamically by Compiler.enableBoot () (TODO: add a disableBoot function.) * config.h is now generated directly in include/urweb/config.h, for consistency's sake (especially since it gets installed along with the rest of the headers!) * All of the autotools build products got updated. * The linkStatic field in protocols now only contains the name of the build product, and not the absolute path. Future users have to be careful not to reference the Settings files to early, lest they get an old version (this was the source of two bugs during development of this patch.)
author Edward Z. Yang <ezyang@mit.edu>
date Wed, 02 May 2012 17:17:57 -0400
parents bacd0ba869e1
children
rev   line source
adamc@230 1 table t1 : {A : int, B : string, C : float}
adamc@230 2 table t2 : {A : float, D : int}
adamc@230 3
adamc@230 4 val q1 = (SELECT * FROM t1 ORDER BY t1.A, t1.B)
adamc@230 5 val q2 = (SELECT * FROM t1 GROUP BY t1.A ORDER BY t1.A, t1.B)
adamc@230 6 val q3 = (SELECT t1.B FROM t1
adamc@230 7 UNION SELECT t1.B FROM t1
adamc@230 8 ORDER BY t1.B)
adamc@234 9
adamc@234 10 val q4 = (SELECT t1.A, t2.D, t1.A < t2.D AS Lt
adamc@234 11 FROM t1, t2
adamc@234 12 ORDER BY Lt)
adamc@261 13 val q5 = (SELECT t1.A, t1.B, t2.D, t1.A < t2.D AS Lt
adamc@234 14 FROM t1, t2
adamc@268 15 ORDER BY t1.A DESC, Lt ASC, t2.D DESC)
adamc@261 16
adamc@261 17
adamc@261 18 datatype list a = Nil | Cons of a * list a
adamc@261 19
adamc@261 20 val r1 : transaction (list string) =
adamc@261 21 query q5
adamc@261 22 (fn fs acc => return (Cons (fs.T1.B, acc)))
adamc@261 23 Nil
adamc@261 24
adamc@261 25 val r2 : transaction string =
adamc@261 26 ls <- r1;
adamc@261 27 return (case ls of
adamc@261 28 Nil => "Problem"
adamc@261 29 | Cons (b, _) => b)
adamc@261 30
adamc@261 31 val main : unit -> transaction page = fn () =>
adamc@261 32 s <- r2;
adamc@261 33 return <html><body>
adamc@261 34 {cdata s}
adamc@261 35 </body></html>