remove commits after pragma

This commit is contained in:
Jack Robison 2019-02-13 22:38:07 -05:00 committed by Lex Berezhny
parent 97e4d51c29
commit 45c6ad3f6d

View file

@ -79,11 +79,9 @@ class AIOSQLite:
raise sqlite3.IntegrityError("foreign keys are disabled, use `AIOSQLite.run` instead") raise sqlite3.IntegrityError("foreign keys are disabled, use `AIOSQLite.run` instead")
try: try:
self.connection.execute('pragma foreign_keys=off') self.connection.execute('pragma foreign_keys=off')
self.connection.commit()
return self.__run_transaction(fun, *args, **kwargs) return self.__run_transaction(fun, *args, **kwargs)
finally: finally:
self.connection.execute('pragma foreign_keys=on') self.connection.execute('pragma foreign_keys=on')
self.connection.commit()
def constraints_to_sql(constraints, joiner=' AND ', prepend_key=''): def constraints_to_sql(constraints, joiner=' AND ', prepend_key=''):