Revision 2788
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
595 | 595 |
return run_query(db, mk_select(db, *args, **kw_args), [], recover, |
596 | 596 |
cacheable, log_level=log_level) |
597 | 597 |
|
598 |
def mk_insert_select(db, table, cols=None, select_query=None, params=None,
|
|
599 |
returning=None, embeddable=False):
|
|
598 |
def mk_insert_select(db, table, cols=None, select_query=None, returning=None,
|
|
599 |
embeddable=False): |
|
600 | 600 |
''' |
601 | 601 |
@param returning str|None An inserted column (such as pkey) to return |
602 | 602 |
@param embeddable Whether the query should be embeddable as a nested SELECT. |
... | ... | |
634 | 634 |
RETURNS '''+return_type+''' |
635 | 635 |
LANGUAGE sql |
636 | 636 |
AS $$ |
637 |
'''+mogrify(db, query, params)+''';
|
|
637 |
'''+query+''';
|
|
638 | 638 |
$$; |
639 | 639 |
''' |
640 | 640 |
run_query(db, function_query, recover=True, cacheable=True, |
... | ... | |
678 | 678 |
if row == []: query = None |
679 | 679 |
else: query = sql_gen.Values(row).to_str(db) |
680 | 680 |
|
681 |
return insert_select(db, table, cols, query, [], *args, **kw_args)
|
|
681 |
return insert_select(db, table, cols, query, *args, **kw_args) |
|
682 | 682 |
|
683 | 683 |
def mk_update(db, table, changes=None, cond=None): |
684 | 684 |
''' |
Also available in: Unified diff
sql.py: mk_insert_select(): Removed no longer used params parameter