Revision 2079
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/db_xml.py | ||
---|---|---|
134 | 134 |
@return tuple(table, col) Where the pkeys (from INSERT RETURNING) are made |
135 | 135 |
available |
136 | 136 |
''' |
137 |
def esc_name(name): return sql.esc_name(db, name) |
|
137 | 138 |
def qual_name(table): return sql.qual_name(db, in_schema, table) |
138 | 139 |
def pkey(table): return sql.pkey(db, table, True) |
139 | 140 |
|
... | ... | |
160 | 161 |
else: row[out_col] = (value, out_col) # value is literal value |
161 | 162 |
|
162 | 163 |
# Insert node |
163 |
sql.insert_select(db, out_table, row.keys(), *sql.mk_select(db, |
|
164 |
qual_name(in_table), row.values(), table_is_esc=True), |
|
165 |
returning=pkey_, into=out_table+'_pkeys') |
|
164 |
pkeys_table = sql.put_table(db, esc_name(out_table), row.keys(), |
|
165 |
qual_name(in_table), row.values(), pkey_, row_ct_ref, table_is_esc=True) |
|
166 | 166 |
|
167 | 167 |
import sys; sys.stderr.write(str(node)) |
168 | 168 |
if commit: db.db.commit() |
Also available in: Unified diff
db_xml.py: put_table() Use new sql.put_table()