checkmate5 4.0.79__tar.gz → 4.0.80__tar.gz
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.
- {checkmate5-4.0.79/checkmate5.egg-info → checkmate5-4.0.80}/PKG-INFO +1 -1
- {checkmate5-4.0.79 → checkmate5-4.0.80/checkmate5.egg-info}/PKG-INFO +1 -1
- checkmate5-4.0.80/lib/models.py +96 -0
- checkmate5-4.0.80/management/helpers.py +110 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/pyproject.toml +1 -1
- {checkmate5-4.0.79 → checkmate5-4.0.80}/setup.py +1 -1
- checkmate5-4.0.79/lib/models.py +0 -1
- checkmate5-4.0.79/management/helpers.py +0 -1
- {checkmate5-4.0.79 → checkmate5-4.0.80}/CHANGELOG.txt +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/LICENSE.txt +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/MANIFEST.in +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/README.md +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/__main__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/all/gptanalyzer/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/all/gptanalyzer/analyzer.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/all/gptanalyzer/issues_data.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/all/gptanalyzer/setup.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/cve/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/cve/text4shell/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/cve/text4shell/analyzer.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/cve/text4shell/issues_data.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/cve/text4shell/setup.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/commands/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/commands/analyze.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/commands/base.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/commands/diff.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/commands/init.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/commands/update_stats.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/hooks/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/hooks/project.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/lib/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/lib/repository.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/lib/repository_pygit2.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/models.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/setup.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/golang/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/golang/gostaticcheck/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/golang/gostaticcheck/analyzer.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/golang/gostaticcheck/issues_data.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/golang/gostaticcheck/setup.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/iac/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/iac/kubescape/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/iac/kubescape/analyzer.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/iac/kubescape/issues_data.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/iac/kubescape/setup.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/iac/tfsec/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/iac/tfsec/analyzer.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/iac/tfsec/issues_data.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/iac/tfsec/setup.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/java/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/java/semgrepjava/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/java/semgrepjava/analyzer.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/java/semgrepjava/issues_data.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/java/semgrepjava/setup.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/javascript/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/javascript/semgrepeslint/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/javascript/semgrepeslint/analyzer.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/javascript/semgrepeslint/issues_data.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/javascript/semgrepeslint/setup.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/perl/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/perl/graudit/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/perl/graudit/analyzer.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/perl/graudit/issues_data.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/perl/graudit/setup.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/python/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/python/bandit/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/python/bandit/analyzer.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/python/bandit/issues_data.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/python/bandit/setup.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/ruby/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/ruby/brakeman/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/ruby/brakeman/analyzer.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/ruby/brakeman/issues_data.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/ruby/brakeman/setup.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/helpers/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/helpers/facts.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/helpers/hashing.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/helpers/issue.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/helpers/settings.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/lib/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/lib/analysis/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/lib/analysis/base.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/lib/code/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/lib/code/environment.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/lib/models.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/lib/stats/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/lib/stats/helpers.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/lib/stats/mapreduce.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/alembic.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/analyze.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/analyzers.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/base.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/compare.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/export.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/info.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/init.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/issues.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/props/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/props/delete.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/props/get.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/props/set.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/reset.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/shell.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/snapshots.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/stats.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/summary.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/sync.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/trend.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/commands/watch.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/decorators.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/management/helpers.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/scripts/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/scripts/manage.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/settings/__init__.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/settings/base.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/settings/defaults.py +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate5.egg-info/SOURCES.txt +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate5.egg-info/dependency_links.txt +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate5.egg-info/entry_points.txt +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate5.egg-info/requires.txt +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate5.egg-info/top_level.txt +0 -0
- {checkmate5-4.0.79 → checkmate5-4.0.80}/setup.cfg +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
from blitzdb import Document
|
|
2
|
+
from blitzdb.backends.sql.backend import Backend as BlitzDBBackend
|
|
3
|
+
from typing import Any, Optional, Dict
|
|
4
|
+
import logging
|
|
5
|
+
from contextlib import contextmanager
|
|
6
|
+
|
|
7
|
+
logger = logging.getLogger(__name__)
|
|
8
|
+
|
|
9
|
+
class Backend(BlitzDBBackend):
|
|
10
|
+
def __init__(self, engine: Any, backend_type: str = 'sql', pool_size: int = 5) -> None:
|
|
11
|
+
"""Initialize BlitzDB backend with specified engine and type.
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
engine: SQL connection engine or file path depending on backend_type
|
|
15
|
+
backend_type: Type of backend ('sql' or 'sqlfile')
|
|
16
|
+
pool_size: Connection pool size for SQL backend
|
|
17
|
+
|
|
18
|
+
Raises:
|
|
19
|
+
ValueError: If backend_type is not supported
|
|
20
|
+
"""
|
|
21
|
+
if backend_type not in ['sql', 'sqlfile']:
|
|
22
|
+
raise ValueError(f"Unsupported backend type: {backend_type}")
|
|
23
|
+
|
|
24
|
+
self.backend_type = backend_type
|
|
25
|
+
self.engine = engine
|
|
26
|
+
self.pool_size = pool_size
|
|
27
|
+
|
|
28
|
+
backend_params = {
|
|
29
|
+
'sql': {
|
|
30
|
+
'connection': engine,
|
|
31
|
+
'backend': 'sql',
|
|
32
|
+
'pool_size': pool_size
|
|
33
|
+
},
|
|
34
|
+
'sqlfile': {
|
|
35
|
+
'path': engine,
|
|
36
|
+
'backend': 'sqlfile'
|
|
37
|
+
}
|
|
38
|
+
}.get(backend_type)
|
|
39
|
+
|
|
40
|
+
logger.debug(f"Initializing {backend_type} backend with params: {backend_params}")
|
|
41
|
+
super().__init__(**backend_params)
|
|
42
|
+
|
|
43
|
+
def test_connection(self) -> bool:
|
|
44
|
+
"""Test the backend connection.
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
bool: True if connection is successful
|
|
48
|
+
|
|
49
|
+
Raises:
|
|
50
|
+
ConnectionError: If connection test fails
|
|
51
|
+
"""
|
|
52
|
+
try:
|
|
53
|
+
if self.backend_type == 'sql':
|
|
54
|
+
with self.engine.connect() as conn:
|
|
55
|
+
conn.execute('SELECT 1')
|
|
56
|
+
elif self.backend_type == 'sqlfile':
|
|
57
|
+
# Test file access
|
|
58
|
+
with open(self.engine, 'a+') as _:
|
|
59
|
+
pass
|
|
60
|
+
logger.info(f"Connection test successful for {self.backend_type} backend")
|
|
61
|
+
return True
|
|
62
|
+
except Exception as e:
|
|
63
|
+
logger.error(f"Connection test failed: {str(e)}")
|
|
64
|
+
raise ConnectionError(f"Connection test failed: {str(e)}")
|
|
65
|
+
|
|
66
|
+
@contextmanager
|
|
67
|
+
def session(self):
|
|
68
|
+
"""Context manager for database sessions.
|
|
69
|
+
|
|
70
|
+
Yields:
|
|
71
|
+
Backend: Self with active session
|
|
72
|
+
|
|
73
|
+
Example:
|
|
74
|
+
with backend.session() as session:
|
|
75
|
+
session.save(document)
|
|
76
|
+
"""
|
|
77
|
+
try:
|
|
78
|
+
yield self
|
|
79
|
+
self.commit()
|
|
80
|
+
except Exception as e:
|
|
81
|
+
logger.error(f"Session error: {str(e)}")
|
|
82
|
+
self.rollback()
|
|
83
|
+
raise
|
|
84
|
+
finally:
|
|
85
|
+
if self.backend_type == 'sql':
|
|
86
|
+
self.engine.dispose()
|
|
87
|
+
|
|
88
|
+
def close(self) -> None:
|
|
89
|
+
"""Properly close backend connections."""
|
|
90
|
+
try:
|
|
91
|
+
if self.backend_type == 'sql':
|
|
92
|
+
self.engine.dispose()
|
|
93
|
+
logger.info(f"Closed {self.backend_type} backend connection")
|
|
94
|
+
except Exception as e:
|
|
95
|
+
logger.error(f"Error closing backend: {str(e)}")
|
|
96
|
+
raise
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
from typing import Any, Dict, Optional
|
|
2
|
+
from sqlalchemy import create_engine
|
|
3
|
+
from sqlalchemy.pool import QueuePool
|
|
4
|
+
import logging
|
|
5
|
+
from ..lib.models import Backend
|
|
6
|
+
from ..exceptions import ConfigurationError
|
|
7
|
+
|
|
8
|
+
logger = logging.getLogger(__name__)
|
|
9
|
+
|
|
10
|
+
def validate_config(config: Dict[str, Any]) -> None:
|
|
11
|
+
"""Validate the configuration dictionary.
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
config: Configuration dictionary to validate
|
|
15
|
+
|
|
16
|
+
Raises:
|
|
17
|
+
ConfigurationError: If configuration is invalid
|
|
18
|
+
"""
|
|
19
|
+
required_fields = {
|
|
20
|
+
'sql': ['host', 'database', 'user'],
|
|
21
|
+
'sqlfile': []
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
backend_type = config.get('backend', {}).get('type', 'sql')
|
|
25
|
+
if backend_type not in required_fields:
|
|
26
|
+
raise ConfigurationError(f"Invalid backend type: {backend_type}")
|
|
27
|
+
|
|
28
|
+
for field in required_fields[backend_type]:
|
|
29
|
+
if not config.get('backend', {}).get(field):
|
|
30
|
+
raise ConfigurationError(f"Missing required field: {field}")
|
|
31
|
+
|
|
32
|
+
def get_connection_string(config: Dict[str, Any]) -> str:
|
|
33
|
+
"""Generate database connection string from config.
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
config: Configuration dictionary
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
str: Database connection string
|
|
40
|
+
|
|
41
|
+
Raises:
|
|
42
|
+
ConfigurationError: If connection string cannot be generated
|
|
43
|
+
"""
|
|
44
|
+
try:
|
|
45
|
+
backend = config.get('backend', {})
|
|
46
|
+
template = "postgresql://{user}:{password}@{host}:{port}/{database}"
|
|
47
|
+
return template.format(
|
|
48
|
+
user=backend.get('user'),
|
|
49
|
+
password=backend.get('password', ''),
|
|
50
|
+
host=backend.get('host', 'localhost'),
|
|
51
|
+
port=backend.get('port', 5432),
|
|
52
|
+
database=backend.get('database')
|
|
53
|
+
)
|
|
54
|
+
except Exception as e:
|
|
55
|
+
raise ConfigurationError(f"Failed to generate connection string: {str(e)}")
|
|
56
|
+
|
|
57
|
+
def get_backend(
|
|
58
|
+
project_path: str,
|
|
59
|
+
project_config: Dict[str, Any],
|
|
60
|
+
settings: Optional[Dict[str, Any]] = None
|
|
61
|
+
) -> Backend:
|
|
62
|
+
"""Create and return appropriate backend based on project configuration.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
project_path: Path to the project
|
|
66
|
+
project_config: Project configuration dictionary
|
|
67
|
+
settings: Optional additional settings
|
|
68
|
+
|
|
69
|
+
Returns:
|
|
70
|
+
Initialized Backend instance
|
|
71
|
+
|
|
72
|
+
Raises:
|
|
73
|
+
ConfigurationError: If configuration is invalid
|
|
74
|
+
ConnectionError: If database connection fails
|
|
75
|
+
"""
|
|
76
|
+
try:
|
|
77
|
+
# Validate configuration
|
|
78
|
+
validate_config(project_config)
|
|
79
|
+
|
|
80
|
+
backend_type = project_config.get('backend', {}).get('type', 'sql')
|
|
81
|
+
pool_size = settings.get('pool_size', 5) if settings else 5
|
|
82
|
+
|
|
83
|
+
logger.info(f"Initializing {backend_type} backend")
|
|
84
|
+
|
|
85
|
+
if backend_type == 'sql':
|
|
86
|
+
connection_string = get_connection_string(project_config)
|
|
87
|
+
engine = create_engine(
|
|
88
|
+
connection_string,
|
|
89
|
+
poolclass=QueuePool,
|
|
90
|
+
pool_size=pool_size,
|
|
91
|
+
max_overflow=10,
|
|
92
|
+
pool_timeout=30
|
|
93
|
+
)
|
|
94
|
+
elif backend_type == 'sqlfile':
|
|
95
|
+
if not project_path:
|
|
96
|
+
raise ConfigurationError("Project path is required for sqlfile backend")
|
|
97
|
+
engine = project_path
|
|
98
|
+
else:
|
|
99
|
+
raise ConfigurationError(f"Unknown backend type: {backend_type}")
|
|
100
|
+
|
|
101
|
+
backend = Backend(engine, backend_type, pool_size)
|
|
102
|
+
|
|
103
|
+
# Test connection
|
|
104
|
+
backend.test_connection()
|
|
105
|
+
|
|
106
|
+
return backend
|
|
107
|
+
|
|
108
|
+
except Exception as e:
|
|
109
|
+
logger.error(f"Backend initialization failed: {str(e)}")
|
|
110
|
+
raise
|
checkmate5-4.0.79/lib/models.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/all/gptanalyzer/__init__.py
RENAMED
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/all/gptanalyzer/analyzer.py
RENAMED
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/all/gptanalyzer/issues_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/cve/text4shell/__init__.py
RENAMED
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/cve/text4shell/analyzer.py
RENAMED
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/cve/text4shell/issues_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/commands/update_stats.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/git/lib/repository_pygit2.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/golang/gostaticcheck/__init__.py
RENAMED
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/golang/gostaticcheck/analyzer.py
RENAMED
|
File without changes
|
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/golang/gostaticcheck/setup.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/iac/kubescape/issues_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/java/semgrepjava/__init__.py
RENAMED
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/java/semgrepjava/analyzer.py
RENAMED
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/java/semgrepjava/issues_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/javascript/semgrepeslint/setup.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/perl/graudit/issues_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/python/bandit/issues_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{checkmate5-4.0.79 → checkmate5-4.0.80}/checkmate/contrib/plugins/ruby/brakeman/issues_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|