checkmate5 4.1.0.dev31__py3-none-any.whl → 4.1.0.dev33__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checkmate/lib/backend.py +1 -64
- checkmate/management/helpers.py +1 -1
- {checkmate5-4.1.0.dev31.dist-info → checkmate5-4.1.0.dev33.dist-info}/METADATA +1 -1
- {checkmate5-4.1.0.dev31.dist-info → checkmate5-4.1.0.dev33.dist-info}/RECORD +8 -8
- {checkmate5-4.1.0.dev31.dist-info → checkmate5-4.1.0.dev33.dist-info}/WHEEL +0 -0
- {checkmate5-4.1.0.dev31.dist-info → checkmate5-4.1.0.dev33.dist-info}/entry_points.txt +0 -0
- {checkmate5-4.1.0.dev31.dist-info → checkmate5-4.1.0.dev33.dist-info}/licenses/LICENSE.txt +0 -0
- {checkmate5-4.1.0.dev31.dist-info → checkmate5-4.1.0.dev33.dist-info}/top_level.txt +0 -0
checkmate/lib/backend.py
CHANGED
|
@@ -6,67 +6,4 @@ from ..helpers.exceptions import DatabaseError
|
|
|
6
6
|
|
|
7
7
|
logger = logging.getLogger(__name__)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
class SQLBackend(BlitzDBSQLBackend):
|
|
11
|
-
def __init__(self, connection: Any) -> None:
|
|
12
|
-
"""Initialize SQL Backend with database connection.
|
|
13
|
-
|
|
14
|
-
Args:
|
|
15
|
-
connection: SQLAlchemy engine or connection object
|
|
16
|
-
|
|
17
|
-
Raises:
|
|
18
|
-
ConnectionError: If database connection fails
|
|
19
|
-
"""
|
|
20
|
-
logger.debug(f"Initializing SQL Backend with connection: {connection}")
|
|
21
|
-
super().__init__(connection)
|
|
22
|
-
self.connection = connection
|
|
23
|
-
|
|
24
|
-
def test_connection(self) -> bool:
|
|
25
|
-
"""Test the database connection.
|
|
26
|
-
|
|
27
|
-
Returns:
|
|
28
|
-
bool: True if connection is successful
|
|
29
|
-
|
|
30
|
-
Raises:
|
|
31
|
-
ConnectionError: If connection test fails
|
|
32
|
-
"""
|
|
33
|
-
try:
|
|
34
|
-
with self.connection.connect() as conn:
|
|
35
|
-
conn.execute('SELECT 1')
|
|
36
|
-
logger.info("Database connection test successful")
|
|
37
|
-
return True
|
|
38
|
-
except Exception as e:
|
|
39
|
-
logger.error(f"Database connection test failed: {str(e)}")
|
|
40
|
-
raise ConnectionError(f"Database connection test failed: {str(e)}")
|
|
41
|
-
|
|
42
|
-
@contextmanager
|
|
43
|
-
def session(self):
|
|
44
|
-
"""Context manager for database sessions.
|
|
45
|
-
|
|
46
|
-
Yields:
|
|
47
|
-
SQLBackend: Self with active session
|
|
48
|
-
"""
|
|
49
|
-
try:
|
|
50
|
-
self.begin()
|
|
51
|
-
yield self
|
|
52
|
-
self.commit()
|
|
53
|
-
except Exception as e:
|
|
54
|
-
logger.error(f"Session error: {str(e)}")
|
|
55
|
-
self.rollback()
|
|
56
|
-
raise
|
|
57
|
-
finally:
|
|
58
|
-
if hasattr(self.connection, 'dispose'):
|
|
59
|
-
self.connection.dispose()
|
|
60
|
-
|
|
61
|
-
def close(self) -> None:
|
|
62
|
-
"""Clean up database connections."""
|
|
63
|
-
try:
|
|
64
|
-
if hasattr(self.connection, 'dispose'):
|
|
65
|
-
self.connection.dispose()
|
|
66
|
-
logger.info("Closed SQL Backend connection")
|
|
67
|
-
except Exception as e:
|
|
68
|
-
logger.error(f"Error closing backend: {str(e)}")
|
|
69
|
-
raise
|
|
70
|
-
|
|
71
|
-
# For backward compatibility
|
|
72
|
-
Backend = SQLBackend # Default to SQLBackend for existing code
|
|
9
|
+
Backend = BlitzDBSQLBackend
|
checkmate/management/helpers.py
CHANGED
|
@@ -107,7 +107,7 @@ def get_project(project_path, project_config, settings, backend):
|
|
|
107
107
|
ProjectClass = settings.models[project_class]
|
|
108
108
|
|
|
109
109
|
# Attempt to find the project by project_id
|
|
110
|
-
project = backend.filter(ProjectClass, {'pk': project_config['project_id']})
|
|
110
|
+
project = backend.filter(ProjectClass, {'pk': project_config['project_id']})
|
|
111
111
|
|
|
112
112
|
# If the project doesn't exist, create a new one
|
|
113
113
|
if project is None:
|
|
@@ -72,7 +72,7 @@ checkmate/helpers/hashing.py,sha256=TcwBFJlciJkLlETQcQBxEWRgwyh2HK9MO4BzN2VMlDU,
|
|
|
72
72
|
checkmate/helpers/issue.py,sha256=7wImtI8uZR5VcE_1u7mI8qvEXU97p6Rzkb1bbJkqXKQ,3841
|
|
73
73
|
checkmate/helpers/settings.py,sha256=97zsz4vNq7EpUpRME4XQvvp5LUp3618ZvSfNTce_4j4,322
|
|
74
74
|
checkmate/lib/__init__.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
|
|
75
|
-
checkmate/lib/backend.py,sha256=
|
|
75
|
+
checkmate/lib/backend.py,sha256=7302LiR5NTaePEsBDxdIHUFqMfnzvMKZi4SyZ7Mc8ms,268
|
|
76
76
|
checkmate/lib/models.py,sha256=bmS_QDDBEMaqC0TiKNaoRBCHuVUK9S-TSBB7BYYJz7Q,7404
|
|
77
77
|
checkmate/lib/analysis/__init__.py,sha256=_JpM1GkChWCfLKqPqEz3-8DCPwNe7lPwQDMoF_6Ore0,45
|
|
78
78
|
checkmate/lib/analysis/base.py,sha256=R9Zy6rKKCw1LSAsBBBaBbgFEo6Fkdx8DTtp7bsYoywE,3309
|
|
@@ -83,7 +83,7 @@ checkmate/lib/stats/helpers.py,sha256=X21Pb7dz3PWubDRoqUjbxwonl43TRxqKEcwyM80tS6
|
|
|
83
83
|
checkmate/lib/stats/mapreduce.py,sha256=rGdA_HninEZSeowtBn5R02c6wyT5dxcu-0T2ftlMnY0,782
|
|
84
84
|
checkmate/management/__init__.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
|
|
85
85
|
checkmate/management/decorators.py,sha256=iwhKnzeBJLKxpRVjvzwiRE63_zNpIBfaKLITauVph-0,24
|
|
86
|
-
checkmate/management/helpers.py,sha256=
|
|
86
|
+
checkmate/management/helpers.py,sha256=tp2eHoKh8IX4MqzqdRNPSww-2v2FdXkewm1SWNWEpgo,4625
|
|
87
87
|
checkmate/management/commands/__init__.py,sha256=XAi0y8z1NviyGvLB68Oxnzr6Nw5AP8xgbcSSnc1Zcvw,766
|
|
88
88
|
checkmate/management/commands/alembic.py,sha256=DTWH8hcY6UmWDo0wMwcID_wQIa-es7nyJHV6p1_T4FQ,718
|
|
89
89
|
checkmate/management/commands/analyze.py,sha256=J1rawVEGjbrXT9ArfUVpfoLNs2JaFkV4mCrBnEIrXaw,1159
|
|
@@ -111,9 +111,9 @@ checkmate/scripts/manage.py,sha256=mpioBaxzirAKXZtbxO-y4dbOcc6UoP0MaAMsNuKHbz0,4
|
|
|
111
111
|
checkmate/settings/__init__.py,sha256=z32hPz-kGS-tTGa6dWCFjrrrbS_eagLd-YrqBP3gjWI,33
|
|
112
112
|
checkmate/settings/base.py,sha256=3WBXZITqoWepIja96bo5JTi-TDpQALPTCugL0E8z-yE,4551
|
|
113
113
|
checkmate/settings/defaults.py,sha256=uK1KB50ukDbk2rACyiCQuXTNSr2M7GXE-2_GTFupbv0,2728
|
|
114
|
-
checkmate5-4.1.0.
|
|
115
|
-
checkmate5-4.1.0.
|
|
116
|
-
checkmate5-4.1.0.
|
|
117
|
-
checkmate5-4.1.0.
|
|
118
|
-
checkmate5-4.1.0.
|
|
119
|
-
checkmate5-4.1.0.
|
|
114
|
+
checkmate5-4.1.0.dev33.dist-info/licenses/LICENSE.txt,sha256=SGQTFjJQjkYGoK1PCFfMKpfgRLm3yL0h9Mq2o26sm2E,151451
|
|
115
|
+
checkmate5-4.1.0.dev33.dist-info/METADATA,sha256=lFyn3cHI1zXR9VIouReKLcN6zZp8EFtqXamv4tVk4Fw,1262
|
|
116
|
+
checkmate5-4.1.0.dev33.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
117
|
+
checkmate5-4.1.0.dev33.dist-info/entry_points.txt,sha256=FbGnau5C4z98WmBYpMJqUzobQEr1AIi9aZApSavNojQ,60
|
|
118
|
+
checkmate5-4.1.0.dev33.dist-info/top_level.txt,sha256=tl6eIJXedpLZbcbmYEwlhEzuTaSt0TvIRUesOb8gtng,10
|
|
119
|
+
checkmate5-4.1.0.dev33.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|