Revision 2312
Added by Aaron Marcuse-Kubitza about 12 years ago
sql.py | ||
---|---|---|
727 | 727 |
Only works under PostgreSQL (uses INSERT RETURNING). |
728 | 728 |
@param in_tables The main input table to select from, followed by a list of |
729 | 729 |
tables to join with it using the main input table's pkey |
730 |
@return sql_gen.Col Where the pkeys (from INSERT RETURNING) are made |
|
731 |
available |
|
730 |
@param mapping dict(out_table_col=in_table_col, ...) |
|
731 |
* out_table_col: sql_gen.Col|str |
|
732 |
* in_table_col: sql_gen.Col Wrap literal values in a sql_gen.NamedCode |
|
733 |
@return sql_gen.Col Where the output pkeys are made available |
|
732 | 734 |
''' |
735 |
for in_table_col in mapping.itervalues(): |
|
736 |
assert isinstance(in_table_col, sql_gen.Col) |
|
737 |
|
|
733 | 738 |
temp_prefix = clean_name(out_table) |
734 | 739 |
pkeys_ref = [temp_prefix+'_pkeys'] |
735 | 740 |
|
Also available in: Unified diff
sql.py: put_table(): Require all in_table_cols to be sql_gen.Col objects