Revision 1998
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/db_xml.py | ||
---|---|---|
116 | 116 |
|
117 | 117 |
return id_ |
118 | 118 |
|
119 |
def put_table(db, node, table, row_ct_ref=None, table_is_esc=False): |
|
120 |
'''@param node The XML tree that transforms the input to the output. Similar |
|
121 |
to put()'s node param, but with the input column name prefixed by "$" |
|
122 |
in place of the column value. |
|
119 |
def put_table(db, node, table, commit=False, row_ct_ref=None, |
|
120 |
table_is_esc=False): |
|
123 | 121 |
''' |
122 |
@param node The XML tree that transforms the input to the output. Similar to |
|
123 |
put()'s node param, but with the input column name prefixed by "$" in |
|
124 |
place of the column value. |
|
125 |
@param commit Whether to commit after each query |
|
126 |
''' |
|
124 | 127 |
import sys; sys.stderr.write(str(node)) |
128 |
if commit: db.db.commit() |
|
125 | 129 |
raise NotImplementedError('By-column optimization not available yet') |
bin/map | ||
---|---|---|
278 | 278 |
row = ['$'+v for v in col_names] # values are the column names |
279 | 279 |
map_table(col_names, [row]) # map just the sample row |
280 | 280 |
xml_func.strip(root) |
281 |
db_xml.put_table(in_db, root.firstChild, table, row_ins_ct_ref,
|
|
282 |
table_is_esc=table_is_esc)
|
|
281 |
db_xml.put_table(in_db, root.firstChild, table, commit,
|
|
282 |
row_ins_ct_ref, table_is_esc)
|
|
283 | 283 |
else: |
284 | 284 |
# Use normal by-row method |
285 | 285 |
row_ct = map_table(col_names, sql.rows(cur), rows_start=start) |
Also available in: Unified diff
db_xml.py: put_table(): Added commit param to specify whether to commit after each query