comparison src/cjr_print.sml @ 325:e457d8972ff1

Crud listing IDs
author Adam Chlipala <adamc@hcoop.net>
date Thu, 11 Sep 2008 17:41:52 -0400
parents b91480c9a729
children 41458a694575
comparison
equal deleted inserted replaced
324:b91480c9a729 325:e457d8972ff1
736 val tables = ListUtil.mapConcat (fn (x, xts) => 736 val tables = ListUtil.mapConcat (fn (x, xts) =>
737 map (fn (x', t) => ("__uwf_" ^ ident x ^ ".__uwf_" ^ ident x', t)) xts) 737 map (fn (x', t) => ("__uwf_" ^ ident x ^ ".__uwf_" ^ ident x', t)) xts)
738 tables 738 tables
739 739
740 val outputs = exps @ tables 740 val outputs = exps @ tables
741 val outputs = ListMergeSort.sort (fn ((s1, _), (s2, _)) => String.compare (s1, s2) = GREATER) outputs
741 742
742 val wontLeakStrings = notLeaky env true state 743 val wontLeakStrings = notLeaky env true state
743 val wontLeakAnything = notLeaky env false state 744 val wontLeakAnything = notLeaky env false state
744 in 745 in
745 box [string "(uw_begin_region(ctx), ", 746 box [string "(uw_begin_region(ctx), ",
1719 "'))"]) xts), 1720 "'))"]) xts),
1720 ")"] 1721 ")"]
1721 1722
1722 val q'' = String.concat ["SELECT COUNT(*) FROM pg_attribute WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = '", 1723 val q'' = String.concat ["SELECT COUNT(*) FROM pg_attribute WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = '",
1723 s, 1724 s,
1724 "') AND attnum >= 0"] 1725 "') AND attname LIKE 'uw_%'"]
1725 in 1726 in
1726 box [string "res = PQexec(conn, \"", 1727 box [string "res = PQexec(conn, \"",
1727 string q, 1728 string q,
1728 string "\");", 1729 string "\");",
1729 newline, 1730 newline,