Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend_api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
videoag
backend_api
Commits
5f66e671
Commit
5f66e671
authored
1 year ago
by
Simon Künzel
Browse files
Options
Downloads
Patches
Plain Diff
Fix a return type
parent
103d37d1
No related branches found
No related tags found
1 merge request
!7
Allow different transaction isolation levels in db and some misc changes
Pipeline
#6097
passed
1 year ago
Stage: build
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/api/database/mysql_connector.py
+1
-1
1 addition, 1 deletion
src/api/database/mysql_connector.py
src/api/database/postgres_connector.py
+1
-1
1 addition, 1 deletion
src/api/database/postgres_connector.py
src/api/database/sqlite_connector.py
+1
-1
1 addition, 1 deletion
src/api/database/sqlite_connector.py
with
3 additions
and
3 deletions
src/api/database/mysql_connector.py
+
1
−
1
View file @
5f66e671
...
@@ -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
}
"
,
...
...
This diff is collapsed.
Click to expand it.
src/api/database/postgres_connector.py
+
1
−
1
View file @
5f66e671
...
@@ -90,7 +90,7 @@ source_function: {diagnostic.source_function}
...
@@ -90,7 +90,7 @@ source_function: {diagnostic.source_function}
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
[
f
"
START TRANSACTION ISOLATION LEVEL
{
isolation_level
.
value
}
, READ WRITE
"
]
return
[
f
"
START TRANSACTION ISOLATION LEVEL
{
isolation_level
.
value
}
, READ WRITE
"
]
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
src/api/database/sqlite_connector.py
+
1
−
1
View file @
5f66e671
...
@@ -62,7 +62,7 @@ class SqLiteDbConnection(PythonDbConnection[Connection, Cursor]):
...
@@ -62,7 +62,7 @@ class SqLiteDbConnection(PythonDbConnection[Connection, Cursor]):
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
]
:
return
[
"
BEGIN DEFERRED TRANSACTION
"
]
# Transactions in SQLite are serializable by default
return
[
"
BEGIN DEFERRED TRANSACTION
"
]
# Transactions in SQLite are serializable by default
def
get_transaction_end_statement
(
self
,
commit
:
bool
)
->
PreparedStatement
or
str
:
def
get_transaction_end_statement
(
self
,
commit
:
bool
)
->
PreparedStatement
or
str
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment