comparison src/cjr_print.sml @ 872:9654bce27cff

Validating views
author Adam Chlipala <adamc@hcoop.net>
date Tue, 30 Jun 2009 16:17:32 -0400
parents 7fa9a37a34b3
children 41971801b62d
comparison
equal deleted inserted replaced
871:3ae6b655ced0 872:9654bce27cff
2576 2576
2577 val pds' = map p_page ps 2577 val pds' = map p_page ps
2578 2578
2579 val hasDb = ref false 2579 val hasDb = ref false
2580 val tables = ref [] 2580 val tables = ref []
2581 val views = ref []
2581 val sequences = ref [] 2582 val sequences = ref []
2582 val dbstring = ref "" 2583 val dbstring = ref ""
2583 val expunge = ref 0 2584 val expunge = ref 0
2584 val initialize = ref 0 2585 val initialize = ref 0
2585 val prepped = ref [] 2586 val prepped = ref []
2590 dbstring := x; 2591 dbstring := x;
2591 expunge := y; 2592 expunge := y;
2592 initialize := z) 2593 initialize := z)
2593 | DTable (s, xts, _, _) => tables := (s, map (fn (x, t) => 2594 | DTable (s, xts, _, _) => tables := (s, map (fn (x, t) =>
2594 (x, sql_type_in env t)) xts) :: !tables 2595 (x, sql_type_in env t)) xts) :: !tables
2596 | DView (s, xts, _) => views := (s, map (fn (x, t) =>
2597 (x, sql_type_in env t)) xts) :: !views
2595 | DSequence s => sequences := s :: !sequences 2598 | DSequence s => sequences := s :: !sequences
2596 | DPreparedStatements ss => prepped := ss 2599 | DPreparedStatements ss => prepped := ss
2597 | _ => ()) ds 2600 | _ => ()) ds
2598 2601
2599 val hasDb = !hasDb 2602 val hasDb = !hasDb
2664 2667
2665 if hasDb then 2668 if hasDb then
2666 #init (Settings.currentDbms ()) {dbstring = !dbstring, 2669 #init (Settings.currentDbms ()) {dbstring = !dbstring,
2667 prepared = !prepped, 2670 prepared = !prepped,
2668 tables = !tables, 2671 tables = !tables,
2672 views = !views,
2669 sequences = !sequences} 2673 sequences = !sequences}
2670 else 2674 else
2671 box [string "void uw_db_init(uw_context ctx) { };", 2675 box [string "void uw_db_init(uw_context ctx) { };",
2672 newline, 2676 newline,
2673 string "int uw_db_begin(uw_context ctx) { return 0; };", 2677 string "int uw_db_begin(uw_context ctx) { return 0; };",