annotate demo/outer.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 87a7702d681d
children
rev   line source
adamc@777 1 table t : { Id : int, B : string }
adamc@777 2 PRIMARY KEY Id
adamc@777 3
adamc@777 4 table u : { Id : int, Link : int, C : string, D : option float }
adamc@777 5 PRIMARY KEY Id,
adamc@777 6 CONSTRAINT Link FOREIGN KEY Link REFERENCES t(Id)
adamc@777 7
adamc@777 8 fun main () =
adamc@777 9 xml <- queryX (SELECT t.Id, t.B, u.Id, u.C, u.D
adamc@777 10 FROM t LEFT JOIN u ON t.Id = u.Link)
adamc@777 11 (fn r => <xml><tr>
adamc@777 12 <td>{[r.T.Id]}</td>
adamc@777 13 <td>{[r.T.B]}</td>
adamc@777 14 <td>{[r.U.Id]}</td>
adamc@777 15 <td>{[r.U.C]}</td>
adamc@777 16 <td>{[r.U.D]}</td>
adamc@777 17 </tr></xml>);
adamc@777 18 return <xml><body>
adamc@777 19 <table>{xml}</table>
adamc@777 20
adamc@777 21 <form>Insert into t: <textbox{#Id} size={5}/> <textbox{#B} size={5}/>
adamc@777 22 <submit action={addT}/></form>
adamc@777 23 <form>
adamc@777 24 Insert into u: <textbox{#Id} size={5}/> <textbox{#Link} size={5}/> <textbox{#C} size={5}/>
adamc@777 25 <textbox{#D} size={5}/> <submit action={addU}/>
adamc@777 26 </form>
adamc@777 27 </body></xml>
adamc@777 28
adamc@777 29 and addT r =
adamc@777 30 dml (INSERT INTO t (Id, B) VALUES ({[readError r.Id]}, {[r.B]}));
adamc@777 31 main ()
adamc@777 32
adamc@777 33 and addU r =
adamc@777 34 dml (INSERT INTO u (Id, Link, C, D) VALUES ({[readError r.Id]}, {[readError r.Link]}, {[r.C]}, {[readError r.D]}));
adamc@777 35 main ()