Skip to content
Snippets Groups Projects

Allow different transaction isolation levels in db and some misc changes

3 files
+ 3
3
Compare changes
  • Side-by-side
  • Inline

Files

@@ -59,7 +59,7 @@ class _MySqlDbConnection(PythonDbConnection[MySQLConnection, MySQLCursor]):
@@ -59,7 +59,7 @@ class _MySqlDbConnection(PythonDbConnection[MySQLConnection, MySQLCursor]):
self._closed = True
self._closed = True
self._py_connection.close()
self._py_connection.close()
def get_transaction_begin_statements(self, writable: bool, isolation_level: TransactionIsolationLevel) -> PreparedStatement or str:
def get_transaction_begin_statements(self, writable: bool, isolation_level: TransactionIsolationLevel) -> list[PreparedStatement or str]:
if writable:
if writable:
return [
return [
f"SET SESSION TRANSACTION ISOLATION LEVEL {isolation_level.value}",
f"SET SESSION TRANSACTION ISOLATION LEVEL {isolation_level.value}",
Loading