thoth-dbmanager 0.4.13__tar.gz → 0.5.0__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.
- {thoth_dbmanager-0.4.13/thoth_dbmanager.egg-info → thoth_dbmanager-0.5.0}/PKG-INFO +2 -2
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/README.md +1 -1
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/pyproject.toml +3 -3
- thoth_dbmanager-0.5.0/thoth_dbmanager/ThothDbManager.py +252 -0
- thoth_dbmanager-0.5.0/thoth_dbmanager/__init__.py +75 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/helpers/multi_db_generator.py +1 -1
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/plugins/sqlite.py +7 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0/thoth_dbmanager.egg-info}/PKG-INFO +2 -2
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager.egg-info/SOURCES.txt +0 -12
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager.egg-info/top_level.txt +0 -1
- thoth_dbmanager-0.4.13/tests/test_integration_new_architecture.py +0 -363
- thoth_dbmanager-0.4.13/tests/test_lsh_query.py +0 -63
- thoth_dbmanager-0.4.13/tests/test_new_architecture.py +0 -471
- thoth_dbmanager-0.4.13/tests/test_parameter_validation.py +0 -68
- thoth_dbmanager-0.4.13/tests/test_thoth_informix_manager.py +0 -41
- thoth_dbmanager-0.4.13/tests/test_thoth_mariadb_manager.py +0 -39
- thoth_dbmanager-0.4.13/tests/test_thoth_mysql_manager.py +0 -39
- thoth_dbmanager-0.4.13/tests/test_thoth_oracle_manager.py +0 -39
- thoth_dbmanager-0.4.13/tests/test_thoth_pg_manager.py +0 -292
- thoth_dbmanager-0.4.13/tests/test_thoth_sqlite_manager.py +0 -390
- thoth_dbmanager-0.4.13/tests/test_thoth_sqlserver_manager.py +0 -39
- thoth_dbmanager-0.4.13/tests/test_thoth_supabase_manager.py +0 -376
- thoth_dbmanager-0.4.13/thoth_dbmanager/ThothDbManager.py +0 -460
- thoth_dbmanager-0.4.13/thoth_dbmanager/__init__.py +0 -130
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/LICENSE +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/MANIFEST.in +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/setup.cfg +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/tests/test_thoth_db_manager_base.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/adapters/__init__.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/adapters/mariadb.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/adapters/mysql.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/adapters/oracle.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/adapters/postgresql.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/adapters/sqlite.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/adapters/sqlserver.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/adapters/supabase.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/core/__init__.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/core/factory.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/core/interfaces.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/core/registry.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/documents.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/dynamic_imports.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/helpers/__init__.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/helpers/preprocess_values.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/helpers/schema.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/helpers/search.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/lsh/__init__.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/lsh/core.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/lsh/factory.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/lsh/manager.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/lsh/storage.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/plugins/__init__.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/plugins/mariadb.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/plugins/mysql.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/plugins/oracle.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/plugins/postgresql.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/plugins/sqlserver.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager/plugins/supabase.py +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager.egg-info/dependency_links.txt +0 -0
- {thoth_dbmanager-0.4.13 → thoth_dbmanager-0.5.0}/thoth_dbmanager.egg-info/requires.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: thoth_dbmanager
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.5.0
|
4
4
|
Summary: A Python library for managing SQL databases with support for multiple database types, LSH-based similarity search, and a modern plugin architecture.
|
5
5
|
Author-email: Marco Pancotti <mp@tylconsulting.it>
|
6
6
|
Project-URL: Homepage, https://github.com/mptyl/thoth_dbmanager
|
@@ -84,7 +84,7 @@ A Python library for managing SQL databases with support for multiple database t
|
|
84
84
|
- **Plugin Architecture**: Extensible design for adding new database types
|
85
85
|
- **LSH Search**: Locality-Sensitive Hashing for finding similar values across database columns
|
86
86
|
- **Type Safety**: Pydantic-based document models for structured data
|
87
|
-
- **
|
87
|
+
- **Modern API**: Clean, plugin-based interface for all database operations
|
88
88
|
|
89
89
|
## Installation
|
90
90
|
|
@@ -8,7 +8,7 @@ A Python library for managing SQL databases with support for multiple database t
|
|
8
8
|
- **Plugin Architecture**: Extensible design for adding new database types
|
9
9
|
- **LSH Search**: Locality-Sensitive Hashing for finding similar values across database columns
|
10
10
|
- **Type Safety**: Pydantic-based document models for structured data
|
11
|
-
- **
|
11
|
+
- **Modern API**: Clean, plugin-based interface for all database operations
|
12
12
|
|
13
13
|
## Installation
|
14
14
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "thoth_dbmanager"
|
7
|
-
version = "0.
|
7
|
+
version = "0.5.0"
|
8
8
|
authors = [
|
9
9
|
{ name="Marco Pancotti", email="mp@tylconsulting.it" },
|
10
10
|
]
|
@@ -81,8 +81,8 @@ test-mysql = ["pytest>=7.0.0", "mysql-connector-python>=8.0.0"]
|
|
81
81
|
|
82
82
|
[tool.setuptools.packages.find]
|
83
83
|
where = ["."]
|
84
|
-
include = ["
|
85
|
-
exclude = ["tests*", "test_*", "*.tests", "*.tests.*", "data*"
|
84
|
+
include = ["thoth_dbmanager*"]
|
85
|
+
exclude = ["tests*", "test_*", "*.tests", "*.tests.*", "data*"]
|
86
86
|
|
87
87
|
[tool.setuptools.package-data]
|
88
88
|
"*" = ["*.md", "*.txt", "*.yml", "*.yaml"]
|
@@ -0,0 +1,252 @@
|
|
1
|
+
import logging
|
2
|
+
from abc import ABC, abstractmethod
|
3
|
+
from pathlib import Path
|
4
|
+
from threading import Lock
|
5
|
+
from typing import Any, Dict, List, Optional, Union, ClassVar, Type, TypeVar
|
6
|
+
|
7
|
+
from .lsh.manager import LshManager
|
8
|
+
from .core.factory import ThothDbFactory
|
9
|
+
|
10
|
+
T = TypeVar('T', bound='ThothDbManager')
|
11
|
+
|
12
|
+
class ThothDbManager(ABC):
|
13
|
+
"""
|
14
|
+
Modern database manager interface using plugin architecture.
|
15
|
+
|
16
|
+
This class provides a unified interface for database operations
|
17
|
+
across multiple database types through the plugin system.
|
18
|
+
"""
|
19
|
+
_instances: ClassVar[Dict[tuple, Any]] = {}
|
20
|
+
_lock: ClassVar[Lock] = Lock()
|
21
|
+
|
22
|
+
@classmethod
|
23
|
+
def get_instance(cls: Type[T], db_type: str, **kwargs) -> T:
|
24
|
+
"""
|
25
|
+
Get or create a singleton instance using the plugin architecture.
|
26
|
+
|
27
|
+
Args:
|
28
|
+
db_type (str): The type of database (e.g., 'postgresql', 'sqlite', 'mysql').
|
29
|
+
**kwargs: Connection parameters specific to the database implementation.
|
30
|
+
|
31
|
+
Returns:
|
32
|
+
An instance of the appropriate database manager.
|
33
|
+
|
34
|
+
Raises:
|
35
|
+
ValueError: If the database type is unsupported or required parameters are missing.
|
36
|
+
"""
|
37
|
+
# Import all plugins to ensure they're registered
|
38
|
+
from . import plugins
|
39
|
+
|
40
|
+
try:
|
41
|
+
# Create plugin instance using factory
|
42
|
+
plugin = ThothDbFactory.create_manager(db_type, **kwargs)
|
43
|
+
return plugin
|
44
|
+
|
45
|
+
except Exception as e:
|
46
|
+
logging.error(f"Failed to create {db_type} manager: {e}")
|
47
|
+
raise ValueError(f"Unsupported database type '{db_type}' or invalid parameters: {e}")
|
48
|
+
|
49
|
+
def __init__(self, db_root_path: str, db_mode: str = "dev", db_type: Optional[str] = None, **kwargs) -> None:
|
50
|
+
"""
|
51
|
+
Initialize the database manager.
|
52
|
+
|
53
|
+
Args:
|
54
|
+
db_root_path (str): Path to the database root directory.
|
55
|
+
db_mode (str, optional): Database mode (dev, prod, etc.). Defaults to "dev".
|
56
|
+
db_type (Optional[str], optional): Type of database. Defaults to None.
|
57
|
+
**kwargs: Additional parameters specific to the database implementation.
|
58
|
+
"""
|
59
|
+
self._validate_common_params(db_root_path, db_mode)
|
60
|
+
|
61
|
+
self.db_root_path = db_root_path
|
62
|
+
self.db_mode = db_mode
|
63
|
+
self.db_type = db_type
|
64
|
+
|
65
|
+
# These will be set by subclasses
|
66
|
+
self.engine = None
|
67
|
+
self.db_id = None
|
68
|
+
self.db_directory_path = None
|
69
|
+
|
70
|
+
# New LSH manager (lazy initialization)
|
71
|
+
self._lsh_manager = None
|
72
|
+
|
73
|
+
# Flag to track initialization
|
74
|
+
self._initialized = False
|
75
|
+
|
76
|
+
def _validate_common_params(self, db_root_path: str, db_mode: str) -> None:
|
77
|
+
"""
|
78
|
+
Validate common parameters for all database implementations.
|
79
|
+
|
80
|
+
Args:
|
81
|
+
db_root_path (str): Path to the database root directory.
|
82
|
+
db_mode (str): Database mode (dev, prod, etc.).
|
83
|
+
|
84
|
+
Raises:
|
85
|
+
ValueError: If parameters are invalid.
|
86
|
+
"""
|
87
|
+
if not db_root_path:
|
88
|
+
raise ValueError("db_root_path is required")
|
89
|
+
|
90
|
+
if not isinstance(db_mode, str):
|
91
|
+
raise TypeError("db_mode must be a string")
|
92
|
+
|
93
|
+
def _setup_directory_path(self, db_id: str) -> None:
|
94
|
+
"""
|
95
|
+
Set up the database directory path.
|
96
|
+
|
97
|
+
Args:
|
98
|
+
db_id (str): Database identifier.
|
99
|
+
"""
|
100
|
+
if isinstance(self.db_root_path, str):
|
101
|
+
self.db_root_path = Path(self.db_root_path)
|
102
|
+
|
103
|
+
self.db_directory_path = self.db_root_path / f"{self.db_mode}_databases" / db_id
|
104
|
+
self.db_id = db_id
|
105
|
+
|
106
|
+
# Reset LSH manager when directory path changes
|
107
|
+
self._lsh_manager = None
|
108
|
+
|
109
|
+
@property
|
110
|
+
def lsh_manager(self) -> Optional[LshManager]:
|
111
|
+
"""
|
112
|
+
Lazy load LSH manager.
|
113
|
+
|
114
|
+
Returns:
|
115
|
+
LshManager instance if db_directory_path is set, None otherwise
|
116
|
+
"""
|
117
|
+
if self._lsh_manager is None and self.db_directory_path:
|
118
|
+
self._lsh_manager = LshManager(self.db_directory_path)
|
119
|
+
return self._lsh_manager
|
120
|
+
|
121
|
+
@abstractmethod
|
122
|
+
def execute_sql(self,
|
123
|
+
sql: str,
|
124
|
+
params: Optional[Dict] = None,
|
125
|
+
fetch: Union[str, int] = "all",
|
126
|
+
timeout: int = 60) -> Any:
|
127
|
+
"""
|
128
|
+
Abstract method to execute SQL queries.
|
129
|
+
|
130
|
+
Args:
|
131
|
+
sql (str): The SQL query to execute.
|
132
|
+
params (Optional[Dict]): Parameters for the SQL query.
|
133
|
+
fetch (Union[str, int]): Specifies how to fetch the results.
|
134
|
+
timeout (int): Timeout for the query execution.
|
135
|
+
|
136
|
+
Returns:
|
137
|
+
Any: The result of the SQL query execution.
|
138
|
+
"""
|
139
|
+
pass
|
140
|
+
|
141
|
+
@abstractmethod
|
142
|
+
def get_unique_values(self) -> Dict[str, Dict[str, List[str]]]:
|
143
|
+
"""
|
144
|
+
Get unique values from the database.
|
145
|
+
|
146
|
+
Returns:
|
147
|
+
Dict[str, Dict[str, List[str]]]: Dictionary where:
|
148
|
+
- outer key is table name
|
149
|
+
- inner key is column name
|
150
|
+
- value is list of unique values
|
151
|
+
"""
|
152
|
+
pass
|
153
|
+
|
154
|
+
@abstractmethod
|
155
|
+
def get_tables(self) -> List[Dict[str, str]]:
|
156
|
+
"""
|
157
|
+
Abstract method to get a list of tables in the database.
|
158
|
+
|
159
|
+
Returns:
|
160
|
+
List[Dict[str, str]]: A list of dictionaries, where each dictionary
|
161
|
+
represents a table with 'name' and 'comment' keys.
|
162
|
+
"""
|
163
|
+
pass
|
164
|
+
|
165
|
+
@abstractmethod
|
166
|
+
def get_columns(self, table_name: str) -> List[Dict[str, Any]]:
|
167
|
+
"""
|
168
|
+
Abstract method to get a list of columns for a given table.
|
169
|
+
|
170
|
+
Args:
|
171
|
+
table_name (str): The name of the table.
|
172
|
+
|
173
|
+
Returns:
|
174
|
+
List[Dict[str, Any]]: A list of dictionaries, where each dictionary
|
175
|
+
represents a column with 'name', 'data_type',
|
176
|
+
'comment', and 'is_pk' keys.
|
177
|
+
"""
|
178
|
+
pass
|
179
|
+
|
180
|
+
@abstractmethod
|
181
|
+
def get_foreign_keys(self) -> List[Dict[str, str]]:
|
182
|
+
"""
|
183
|
+
Abstract method to get a list of foreign key relationships in the database.
|
184
|
+
|
185
|
+
Returns:
|
186
|
+
List[Dict[str, str]]: A list of dictionaries, where each dictionary
|
187
|
+
represents a foreign key relationship with
|
188
|
+
'source_table_name', 'source_column_name',
|
189
|
+
'target_table_name', and 'target_column_name' keys.
|
190
|
+
"""
|
191
|
+
pass
|
192
|
+
|
193
|
+
@abstractmethod
|
194
|
+
def get_example_data(self, table_name: str, number_of_rows: int = 30) -> Dict[str, List[Any]]:
|
195
|
+
"""
|
196
|
+
Abstract method to get example data (most frequent values) for each column in a table.
|
197
|
+
|
198
|
+
Args:
|
199
|
+
table_name (str): The name of the table.
|
200
|
+
number_of_rows (int, optional): Maximum number of example values to return per column. Defaults to 30.
|
201
|
+
|
202
|
+
Returns:
|
203
|
+
Dict[str, List[Any]]: A dictionary mapping column names to lists of example values.
|
204
|
+
"""
|
205
|
+
pass
|
206
|
+
|
207
|
+
def query_lsh(self,
|
208
|
+
keyword: str,
|
209
|
+
signature_size: int = 30,
|
210
|
+
n_gram: int = 3,
|
211
|
+
top_n: int = 10) -> Dict[str, Dict[str, List[str]]]:
|
212
|
+
"""
|
213
|
+
Queries the LSH for similar values to the given keyword.
|
214
|
+
|
215
|
+
Args:
|
216
|
+
keyword (str): The keyword to search for.
|
217
|
+
signature_size (int, optional): The size of the MinHash signature. Defaults to 30.
|
218
|
+
n_gram (int, optional): The n-gram size for the MinHash. Defaults to 3.
|
219
|
+
top_n (int, optional): The number of top results to return. Defaults to 10.
|
220
|
+
|
221
|
+
Returns:
|
222
|
+
Dict[str, Dict[str, List[str]]]: Dictionary where:
|
223
|
+
- outer key is table name
|
224
|
+
- inner key is column name
|
225
|
+
- value is list of similar strings
|
226
|
+
"""
|
227
|
+
if self.lsh_manager:
|
228
|
+
try:
|
229
|
+
return self.lsh_manager.query(
|
230
|
+
keyword=keyword,
|
231
|
+
signature_size=signature_size,
|
232
|
+
n_gram=n_gram,
|
233
|
+
top_n=top_n
|
234
|
+
)
|
235
|
+
except Exception as e:
|
236
|
+
logging.error(f"LSH manager query failed: {e}")
|
237
|
+
raise Exception(f"Error querying LSH for {self.db_id}: {e}")
|
238
|
+
else:
|
239
|
+
raise Exception(f"LSH manager not initialized for {self.db_id}")
|
240
|
+
|
241
|
+
def health_check(self) -> bool:
|
242
|
+
"""
|
243
|
+
Check if database connection is healthy.
|
244
|
+
|
245
|
+
Returns:
|
246
|
+
bool: True if connection is healthy, False otherwise
|
247
|
+
"""
|
248
|
+
try:
|
249
|
+
self.execute_sql("SELECT 1", fetch="one")
|
250
|
+
return True
|
251
|
+
except Exception:
|
252
|
+
return False
|
@@ -0,0 +1,75 @@
|
|
1
|
+
"""
|
2
|
+
Thoth Database Manager - A unified interface for multiple database systems.
|
3
|
+
|
4
|
+
This package provides database-agnostic operations, LSH similarity search,
|
5
|
+
and an extensible plugin architecture for managing SQL databases.
|
6
|
+
"""
|
7
|
+
|
8
|
+
# Core classes
|
9
|
+
from .ThothDbManager import ThothDbManager
|
10
|
+
from .core.factory import ThothDbFactory
|
11
|
+
from .core.interfaces import DbPlugin, DbAdapter
|
12
|
+
from .core.registry import DbPluginRegistry
|
13
|
+
|
14
|
+
# Document models
|
15
|
+
from .documents import (
|
16
|
+
BaseThothDbDocument,
|
17
|
+
TableDocument,
|
18
|
+
ColumnDocument,
|
19
|
+
QueryDocument,
|
20
|
+
SchemaDocument,
|
21
|
+
ForeignKeyDocument,
|
22
|
+
IndexDocument,
|
23
|
+
ThothDbType,
|
24
|
+
create_document
|
25
|
+
)
|
26
|
+
|
27
|
+
# LSH functionality
|
28
|
+
from .lsh.factory import make_db_lsh
|
29
|
+
from .lsh import LshManager, LshFactory
|
30
|
+
|
31
|
+
# Dynamic import system
|
32
|
+
from .dynamic_imports import (
|
33
|
+
import_manager,
|
34
|
+
import_adapter,
|
35
|
+
import_plugin,
|
36
|
+
get_available_databases,
|
37
|
+
import_database_components,
|
38
|
+
DatabaseImportError,
|
39
|
+
)
|
40
|
+
|
41
|
+
# Public API - Modern Plugin Architecture Only
|
42
|
+
__all__ = [
|
43
|
+
# Core API
|
44
|
+
"ThothDbManager",
|
45
|
+
"ThothDbFactory",
|
46
|
+
"DbPluginRegistry",
|
47
|
+
"DbPlugin",
|
48
|
+
"DbAdapter",
|
49
|
+
|
50
|
+
# Document models
|
51
|
+
"BaseThothDbDocument",
|
52
|
+
"TableDocument",
|
53
|
+
"ColumnDocument",
|
54
|
+
"QueryDocument",
|
55
|
+
"SchemaDocument",
|
56
|
+
"ForeignKeyDocument",
|
57
|
+
"IndexDocument",
|
58
|
+
"ThothDbType",
|
59
|
+
"create_document",
|
60
|
+
|
61
|
+
# LSH functionality
|
62
|
+
"make_db_lsh",
|
63
|
+
"LshManager",
|
64
|
+
"LshFactory",
|
65
|
+
|
66
|
+
# Dynamic import system
|
67
|
+
"import_manager",
|
68
|
+
"import_adapter",
|
69
|
+
"import_plugin",
|
70
|
+
"get_available_databases",
|
71
|
+
"import_database_components",
|
72
|
+
"DatabaseImportError",
|
73
|
+
]
|
74
|
+
|
75
|
+
__version__ = "0.5.0"
|
@@ -218,3 +218,10 @@ class SQLitePlugin(DbPlugin):
|
|
218
218
|
return self.adapter.get_example_data(table_name, number_of_rows)
|
219
219
|
else:
|
220
220
|
raise RuntimeError("Plugin not initialized")
|
221
|
+
|
222
|
+
def health_check(self) -> bool:
|
223
|
+
"""Check database connection health"""
|
224
|
+
if self.adapter:
|
225
|
+
return self.adapter.health_check()
|
226
|
+
else:
|
227
|
+
return False
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: thoth_dbmanager
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.5.0
|
4
4
|
Summary: A Python library for managing SQL databases with support for multiple database types, LSH-based similarity search, and a modern plugin architecture.
|
5
5
|
Author-email: Marco Pancotti <mp@tylconsulting.it>
|
6
6
|
Project-URL: Homepage, https://github.com/mptyl/thoth_dbmanager
|
@@ -84,7 +84,7 @@ A Python library for managing SQL databases with support for multiple database t
|
|
84
84
|
- **Plugin Architecture**: Extensible design for adding new database types
|
85
85
|
- **LSH Search**: Locality-Sensitive Hashing for finding similar values across database columns
|
86
86
|
- **Type Safety**: Pydantic-based document models for structured data
|
87
|
-
- **
|
87
|
+
- **Modern API**: Clean, plugin-based interface for all database operations
|
88
88
|
|
89
89
|
## Installation
|
90
90
|
|
@@ -2,19 +2,7 @@ LICENSE
|
|
2
2
|
MANIFEST.in
|
3
3
|
README.md
|
4
4
|
pyproject.toml
|
5
|
-
tests/test_integration_new_architecture.py
|
6
|
-
tests/test_lsh_query.py
|
7
|
-
tests/test_new_architecture.py
|
8
|
-
tests/test_parameter_validation.py
|
9
5
|
tests/test_thoth_db_manager_base.py
|
10
|
-
tests/test_thoth_informix_manager.py
|
11
|
-
tests/test_thoth_mariadb_manager.py
|
12
|
-
tests/test_thoth_mysql_manager.py
|
13
|
-
tests/test_thoth_oracle_manager.py
|
14
|
-
tests/test_thoth_pg_manager.py
|
15
|
-
tests/test_thoth_sqlite_manager.py
|
16
|
-
tests/test_thoth_sqlserver_manager.py
|
17
|
-
tests/test_thoth_supabase_manager.py
|
18
6
|
thoth_dbmanager/ThothDbManager.py
|
19
7
|
thoth_dbmanager/__init__.py
|
20
8
|
thoth_dbmanager/documents.py
|