File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2804,7 +2804,7 @@ def build_insert_queries_and_params(
28042804 # them since it ignores the resulting integrity errors
28052805 if not_null :
28062806 placeholders .extend (not_null )
2807- sql = "INSERT OR IGNORE INTO [{table}]({cols}) VALUES({placeholders});" .format (
2807+ sql = "INSERT OR IGNORE INTO [{table}]({cols}) VALUES({placeholders}) RETURNING * ;" .format (
28082808 table = self .name ,
28092809 cols = ", " .join (["[{}]" .format (p ) for p in placeholders ]),
28102810 placeholders = ", " .join (["?" for p in placeholders ]),
@@ -2815,7 +2815,7 @@ def build_insert_queries_and_params(
28152815 # UPDATE [book] SET [name] = 'Programming' WHERE [id] = 1001;
28162816 set_cols = [col for col in all_columns if col not in pks ]
28172817 if set_cols :
2818- sql2 = "UPDATE [{table}] SET {pairs} WHERE {wheres}" .format (
2818+ sql2 = "UPDATE [{table}] SET {pairs} WHERE {wheres} RETURNING * " .format (
28192819 table = self .name ,
28202820 pairs = ", " .join (
28212821 "[{}] = {}" .format (col , conversions .get (col , "?" ))
@@ -2843,7 +2843,7 @@ def build_insert_queries_and_params(
28432843 elif ignore :
28442844 or_what = "OR IGNORE "
28452845 sql = """
2846- INSERT {or_what}INTO [{table}] ({columns}) VALUES {rows};
2846+ INSERT {or_what}INTO [{table}] ({columns}) VALUES {rows} RETURNING * ;
28472847 """ .strip ().format (
28482848 or_what = or_what ,
28492849 table = self .name ,
You can’t perform that action at this time.
0 commit comments