pylint
This commit is contained in:
parent
45c6ad3f6d
commit
09726876ad
1 changed files with 3 additions and 2 deletions
|
@ -72,8 +72,9 @@ class AIOSQLite:
|
|||
self.executor.submit(self.__run_transaction_with_foreign_keys_disabled, fun, *args, **kwargs)
|
||||
)
|
||||
|
||||
def __run_transaction_with_foreign_keys_disabled(self, fun: Callable[[sqlite3.Connection, Any, Any], Any], *args,
|
||||
**kwargs):
|
||||
def __run_transaction_with_foreign_keys_disabled(self,
|
||||
fun: Callable[[sqlite3.Connection, Any, Any], Any],
|
||||
*args, **kwargs):
|
||||
foreign_keys_enabled, = self.connection.execute("pragma foreign_keys").fetchone()
|
||||
if not foreign_keys_enabled:
|
||||
raise sqlite3.IntegrityError("foreign keys are disabled, use `AIOSQLite.run` instead")
|
||||
|
|
Loading…
Reference in a new issue