annotate tests/cst.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 0f42461273cf
children
rev   line source
adamc@714 1 table u : {C : int, D : int, E : option int, F : string}
adamc@709 2 PRIMARY KEY C,
adamc@712 3 CONSTRAINT U UNIQUE (C, D),
adamc@714 4 CONSTRAINT U2 UNIQUE E,
adamc@714 5
adamc@714 6 CONSTRAINT Pos CHECK D > 0,
adamc@714 7 CONSTRAINT NoNo CHECK C + D <> 2,
adamc@714 8 CONSTRAINT Known CHECK F = "_E = 6"
adamc@709 9
adamc@712 10 table t : {A : int, B : int, C : option int}
adamc@707 11 PRIMARY KEY B,
adamc@707 12
adamc@704 13 CONSTRAINT UniA UNIQUE A,
adamc@704 14 CONSTRAINT UniB UNIQUE B,
adamc@704 15 CONSTRAINT UniBoth UNIQUE (A, B),
adamc@704 16
adamc@704 17 CONSTRAINT UniAm UNIQUE {#A},
adamc@705 18 CONSTRAINT UniAm2 {unique [#A] [[]] ! !},
adamc@705 19 {{one_constraint [#UniAm3] (unique [#A] [[]] ! !)}},
adamc@705 20
adamc@705 21 CONSTRAINT UniBothm UNIQUE ({#A}, {#B}),
adamc@705 22 CONSTRAINT UniBothm2 {unique [#A] [[B = _]] ! !},
adamc@709 23 {{one_constraint [#UniBothm3] (unique [#A] [[B = _]] ! !)}},
adamc@709 24
adamc@709 25 CONSTRAINT ForA FOREIGN KEY A REFERENCES u (C),
adamc@709 26 CONSTRAINT ForAB FOREIGN KEY (A, B) REFERENCES u (D, C) ON DELETE CASCADE ON UPDATE RESTRICT,
adamc@709 27 CONSTRAINT ForBA FOREIGN KEY (A, B) REFERENCES u (C, D) ON UPDATE NO ACTION,
adamc@712 28 CONSTRAINT ForB FOREIGN KEY B REFERENCES u (E),
adamc@713 29 CONSTRAINT ForC FOREIGN KEY C REFERENCES u (C),
adamc@709 30
adamc@713 31 CONSTRAINT Self FOREIGN KEY B REFERENCES t (B)
adamc@709 32
adamc@709 33 table s : {B : option int}
adamc@709 34 CONSTRAINT UniB UNIQUE B
adamc@709 35
adamc@709 36 table s2 : {B : option int}
adamc@709 37 CONSTRAINT ForB FOREIGN KEY B REFERENCES s (B) ON DELETE SET NULL
adamc@704 38
adamc@704 39 fun main () : transaction page =
adamc@704 40 queryI (SELECT * FROM t) (fn _ => return ());
adamc@704 41 return <xml/>