comparison src/cjr_print.sml @ 879:b2a175a0f2ef

Demo working with MySQL
author Adam Chlipala <adamc@hcoop.net>
date Thu, 16 Jul 2009 18:10:29 -0400
parents a8952047e1d3
children 8e9f2d247dba
comparison
equal deleted inserted replaced
878:a8952047e1d3 879:b2a175a0f2ef
1652 1652
1653 #query (Settings.currentDbms ()) 1653 #query (Settings.currentDbms ())
1654 {loc = loc, 1654 {loc = loc,
1655 cols = map (fn (_, t) => sql_type_in env t) outputs, 1655 cols = map (fn (_, t) => sql_type_in env t) outputs,
1656 doCols = doCols}] 1656 doCols = doCols}]
1657 | SOME (id, query) => 1657 | SOME {id, query, nested} =>
1658 box [p_list_sepi newline 1658 box [p_list_sepi newline
1659 (fn i => fn (e, t) => 1659 (fn i => fn (e, t) =>
1660 box [p_sql_type t, 1660 box [p_sql_type t,
1661 space, 1661 space,
1662 string "arg", 1662 string "arg",
1674 {loc = loc, 1674 {loc = loc,
1675 id = id, 1675 id = id,
1676 query = query, 1676 query = query,
1677 inputs = map #2 inputs, 1677 inputs = map #2 inputs,
1678 cols = map (fn (_, t) => sql_type_in env t) outputs, 1678 cols = map (fn (_, t) => sql_type_in env t) outputs,
1679 doCols = doCols}], 1679 doCols = doCols,
1680 nested = nested}],
1680 newline, 1681 newline,
1681 1682
1682 if wontLeakAnything then 1683 if wontLeakAnything then
1683 box [string "uw_end_region(ctx);", 1684 box [string "uw_end_region(ctx);",
1684 newline] 1685 newline]
1701 p_exp env dml, 1702 p_exp env dml,
1702 string ";", 1703 string ";",
1703 newline, 1704 newline,
1704 newline, 1705 newline,
1705 #dml (Settings.currentDbms ()) loc] 1706 #dml (Settings.currentDbms ()) loc]
1706 | SOME (id, dml') => 1707 | SOME {id, dml = dml'} =>
1707 let 1708 let
1708 val inputs = getPargs dml 1709 val inputs = getPargs dml
1709 in 1710 in
1710 box [p_list_sepi newline 1711 box [p_list_sepi newline
1711 (fn i => fn (e, t) => 1712 (fn i => fn (e, t) =>
1746 NONE => #nextval (Settings.currentDbms ()) {loc = loc, 1747 NONE => #nextval (Settings.currentDbms ()) {loc = loc,
1747 seqE = p_exp env seq, 1748 seqE = p_exp env seq,
1748 seqName = case #1 seq of 1749 seqName = case #1 seq of
1749 EPrim (Prim.String s) => SOME s 1750 EPrim (Prim.String s) => SOME s
1750 | _ => NONE} 1751 | _ => NONE}
1751 | SOME (id, query) => #nextvalPrepared (Settings.currentDbms ()) {loc = loc, 1752 | SOME {id, query} => #nextvalPrepared (Settings.currentDbms ()) {loc = loc,
1752 id = id, 1753 id = id,
1753 query = query}, 1754 query = query},
1754 newline, 1755 newline,
1755 newline, 1756 newline,
1756 1757