thoth-dbmanager 0.4.1__py3-none-any.whl → 0.4.3__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.
- thoth_dbmanager/__init__.py +1 -7
- thoth_dbmanager/dynamic_imports.py +36 -44
- {thoth_dbmanager-0.4.1.dist-info → thoth_dbmanager-0.4.3.dist-info}/METADATA +13 -8
- {thoth_dbmanager-0.4.1.dist-info → thoth_dbmanager-0.4.3.dist-info}/RECORD +7 -7
- {thoth_dbmanager-0.4.1.dist-info → thoth_dbmanager-0.4.3.dist-info}/WHEEL +0 -0
- {thoth_dbmanager-0.4.1.dist-info → thoth_dbmanager-0.4.3.dist-info}/licenses/LICENSE +0 -0
- {thoth_dbmanager-0.4.1.dist-info → thoth_dbmanager-0.4.3.dist-info}/top_level.txt +0 -0
thoth_dbmanager/__init__.py
CHANGED
@@ -43,7 +43,6 @@ from .dynamic_imports import (
|
|
43
43
|
import_sqlserver,
|
44
44
|
import_oracle,
|
45
45
|
import_mariadb,
|
46
|
-
import_informix,
|
47
46
|
import_supabase,
|
48
47
|
)
|
49
48
|
|
@@ -62,8 +61,6 @@ def __getattr__(name: str):
|
|
62
61
|
return import_manager('sqlserver')
|
63
62
|
elif name == 'ThothOracleManager':
|
64
63
|
return import_manager('oracle')
|
65
|
-
elif name == 'ThothInformixManager':
|
66
|
-
return import_manager('informix')
|
67
64
|
elif name == 'ThothSupabaseManager':
|
68
65
|
return import_manager('supabase')
|
69
66
|
|
@@ -79,7 +76,6 @@ __all__ = [
|
|
79
76
|
"ThothMariaDbManager",
|
80
77
|
"ThothSqlServerManager",
|
81
78
|
"ThothOracleManager",
|
82
|
-
"ThothInformixManager",
|
83
79
|
"ThothSupabaseManager",
|
84
80
|
|
85
81
|
# New architecture
|
@@ -106,7 +102,6 @@ __all__ = [
|
|
106
102
|
"MariaDBPlugin",
|
107
103
|
"SQLServerPlugin",
|
108
104
|
"OraclePlugin",
|
109
|
-
"InformixPlugin",
|
110
105
|
"SupabasePlugin",
|
111
106
|
|
112
107
|
# Adapters
|
@@ -116,7 +111,6 @@ __all__ = [
|
|
116
111
|
"MariaDBAdapter",
|
117
112
|
"SQLServerAdapter",
|
118
113
|
"OracleAdapter",
|
119
|
-
"InformixAdapter",
|
120
114
|
"SupabaseAdapter",
|
121
115
|
|
122
116
|
# LSH functionality
|
@@ -133,4 +127,4 @@ __all__ = [
|
|
133
127
|
"DatabaseImportError",
|
134
128
|
]
|
135
129
|
|
136
|
-
__version__ = "0.4.
|
130
|
+
__version__ = "0.4.3"
|
@@ -14,45 +14,32 @@ DATABASE_DEPENDENCIES = {
|
|
14
14
|
'mariadb': ['mariadb'],
|
15
15
|
'sqlserver': ['pyodbc'],
|
16
16
|
'oracle': ['cx_Oracle'],
|
17
|
-
'informix': ['informixdb'],
|
18
17
|
'supabase': ['supabase', 'postgrest', 'gotrue'],
|
19
18
|
'sqlite': [], # Built into Python
|
20
19
|
}
|
21
20
|
|
22
|
-
#
|
23
|
-
DATABASE_MANAGERS = {
|
24
|
-
'postgresql': 'dbmanager.impl.ThothPgManager.ThothPgManager',
|
25
|
-
'mysql': 'dbmanager.impl.ThothMySqlManager.ThothMySqlManager',
|
26
|
-
'mariadb': 'dbmanager.impl.ThothMariaDbManager.ThothMariaDbManager',
|
27
|
-
'sqlserver': 'dbmanager.impl.ThothSqlServerManager.ThothSqlServerManager',
|
28
|
-
'oracle': 'dbmanager.impl.ThothOracleManager.ThothOracleManager',
|
29
|
-
'informix': 'dbmanager.impl.ThothInformixManager.ThothInformixManager',
|
30
|
-
'supabase': 'dbmanager.impl.ThothSupabaseManager.ThothSupabaseManager',
|
31
|
-
'sqlite': 'dbmanager.impl.ThothSqliteManager.ThothSqliteManager',
|
32
|
-
}
|
21
|
+
# Note: DATABASE_MANAGERS is no longer used - managers are created via factory pattern
|
33
22
|
|
34
23
|
# Mapping of database names to their adapter classes
|
35
24
|
DATABASE_ADAPTERS = {
|
36
|
-
'postgresql': '
|
37
|
-
'mysql': '
|
38
|
-
'mariadb': '
|
39
|
-
'sqlserver': '
|
40
|
-
'oracle': '
|
41
|
-
'
|
42
|
-
'
|
43
|
-
'sqlite': 'dbmanager.adapters.sqlite.SQLiteAdapter',
|
25
|
+
'postgresql': 'thoth_dbmanager.adapters.postgresql.PostgreSQLAdapter',
|
26
|
+
'mysql': 'thoth_dbmanager.adapters.mysql.MySQLAdapter',
|
27
|
+
'mariadb': 'thoth_dbmanager.adapters.mariadb.MariaDBAdapter',
|
28
|
+
'sqlserver': 'thoth_dbmanager.adapters.sqlserver.SQLServerAdapter',
|
29
|
+
'oracle': 'thoth_dbmanager.adapters.oracle.OracleAdapter',
|
30
|
+
'supabase': 'thoth_dbmanager.adapters.supabase.SupabaseAdapter',
|
31
|
+
'sqlite': 'thoth_dbmanager.adapters.sqlite.SQLiteAdapter',
|
44
32
|
}
|
45
33
|
|
46
34
|
# Mapping of database names to their plugin classes
|
47
35
|
DATABASE_PLUGINS = {
|
48
|
-
'postgresql': '
|
49
|
-
'mysql': '
|
50
|
-
'mariadb': '
|
51
|
-
'sqlserver': '
|
52
|
-
'oracle': '
|
53
|
-
'
|
54
|
-
'
|
55
|
-
'sqlite': 'dbmanager.plugins.sqlite.SQLitePlugin',
|
36
|
+
'postgresql': 'thoth_dbmanager.plugins.postgresql.PostgreSQLPlugin',
|
37
|
+
'mysql': 'thoth_dbmanager.plugins.mysql.MySQLPlugin',
|
38
|
+
'mariadb': 'thoth_dbmanager.plugins.mariadb.MariaDBPlugin',
|
39
|
+
'sqlserver': 'thoth_dbmanager.plugins.sqlserver.SQLServerPlugin',
|
40
|
+
'oracle': 'thoth_dbmanager.plugins.oracle.OraclePlugin',
|
41
|
+
'supabase': 'thoth_dbmanager.plugins.supabase.SupabasePlugin',
|
42
|
+
'sqlite': 'thoth_dbmanager.plugins.sqlite.SQLitePlugin',
|
56
43
|
}
|
57
44
|
|
58
45
|
|
@@ -93,30 +80,39 @@ def check_dependencies(database: str) -> List[str]:
|
|
93
80
|
|
94
81
|
def import_manager(database: str) -> Any:
|
95
82
|
"""
|
96
|
-
Dynamically import a database manager
|
97
|
-
|
83
|
+
Dynamically import a database manager using the factory pattern.
|
84
|
+
|
98
85
|
Args:
|
99
86
|
database: Name of the database
|
100
|
-
|
87
|
+
|
101
88
|
Returns:
|
102
|
-
The database manager class
|
103
|
-
|
89
|
+
The database manager class (factory-created)
|
90
|
+
|
104
91
|
Raises:
|
105
92
|
DatabaseImportError: If dependencies are missing
|
106
93
|
ImportError: If the manager class cannot be imported
|
107
94
|
"""
|
108
|
-
if database not in
|
95
|
+
if database not in DATABASE_PLUGINS:
|
109
96
|
raise ValueError(f"Unknown database: {database}")
|
110
|
-
|
97
|
+
|
111
98
|
# Check dependencies
|
112
99
|
missing_deps = check_dependencies(database)
|
113
100
|
if missing_deps:
|
114
101
|
raise DatabaseImportError(database, missing_deps)
|
115
|
-
|
116
|
-
# Import the manager class
|
117
|
-
|
118
|
-
|
119
|
-
|
102
|
+
|
103
|
+
# Import the factory and create a manager class
|
104
|
+
from thoth_dbmanager.core.factory import ThothDbFactory
|
105
|
+
|
106
|
+
# Create a wrapper class that can be instantiated like the old managers
|
107
|
+
class DatabaseManagerWrapper:
|
108
|
+
def __init__(self, *args, **kwargs):
|
109
|
+
# Create manager using factory
|
110
|
+
self._manager = ThothDbFactory.create_manager(database, *args, **kwargs)
|
111
|
+
|
112
|
+
def __getattr__(self, name):
|
113
|
+
return getattr(self._manager, name)
|
114
|
+
|
115
|
+
return DatabaseManagerWrapper
|
120
116
|
|
121
117
|
|
122
118
|
def import_adapter(database: str) -> Any:
|
@@ -241,10 +237,6 @@ def import_mariadb():
|
|
241
237
|
"""Import MariaDB components."""
|
242
238
|
return import_database_components(['mariadb'])['mariadb']
|
243
239
|
|
244
|
-
def import_informix():
|
245
|
-
"""Import Informix components."""
|
246
|
-
return import_database_components(['informix'])['informix']
|
247
|
-
|
248
240
|
def import_supabase():
|
249
241
|
"""Import Supabase components."""
|
250
242
|
return import_database_components(['supabase'])['supabase']
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: thoth_dbmanager
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.3
|
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
|
License: MIT
|
@@ -28,6 +28,8 @@ Requires-Dist: datasketch>=1.5.0
|
|
28
28
|
Requires-Dist: tqdm>=4.60.0
|
29
29
|
Requires-Dist: SQLAlchemy>=1.4.0
|
30
30
|
Requires-Dist: pydantic>=2.0.0
|
31
|
+
Requires-Dist: pandas>=1.3.0
|
32
|
+
Requires-Dist: requests>=2.25.0
|
31
33
|
Provides-Extra: postgresql
|
32
34
|
Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgresql"
|
33
35
|
Provides-Extra: mysql
|
@@ -36,25 +38,24 @@ Provides-Extra: mariadb
|
|
36
38
|
Requires-Dist: mariadb>=1.1.0; extra == "mariadb"
|
37
39
|
Provides-Extra: sqlserver
|
38
40
|
Requires-Dist: pyodbc>=4.0.0; extra == "sqlserver"
|
41
|
+
Requires-Dist: pymssql>=2.3.0; extra == "sqlserver"
|
39
42
|
Provides-Extra: oracle
|
40
43
|
Requires-Dist: cx_Oracle>=8.3.0; extra == "oracle"
|
41
|
-
|
42
|
-
Requires-Dist: informixdb>=2.2.0; extra == "informix"
|
44
|
+
Requires-Dist: oracledb>=3.0.0; extra == "oracle"
|
43
45
|
Provides-Extra: supabase
|
44
46
|
Requires-Dist: supabase>=2.0.0; extra == "supabase"
|
45
|
-
Requires-Dist: postgrest-py>=0.
|
46
|
-
Requires-Dist: gotrue-py>=
|
47
|
+
Requires-Dist: postgrest-py>=0.10.0; extra == "supabase"
|
48
|
+
Requires-Dist: gotrue-py>=1.0.0; extra == "supabase"
|
47
49
|
Provides-Extra: sqlite
|
48
50
|
Provides-Extra: all
|
49
51
|
Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
|
50
52
|
Requires-Dist: mysql-connector-python>=8.0.0; extra == "all"
|
51
53
|
Requires-Dist: mariadb>=1.1.0; extra == "all"
|
52
54
|
Requires-Dist: pyodbc>=4.0.0; extra == "all"
|
55
|
+
Requires-Dist: pymssql>=2.3.0; extra == "all"
|
53
56
|
Requires-Dist: cx_Oracle>=8.3.0; extra == "all"
|
54
|
-
Requires-Dist:
|
57
|
+
Requires-Dist: oracledb>=3.0.0; extra == "all"
|
55
58
|
Requires-Dist: supabase>=2.0.0; extra == "all"
|
56
|
-
Requires-Dist: postgrest-py>=0.16.0; extra == "all"
|
57
|
-
Requires-Dist: gotrue-py>=2.0.0; extra == "all"
|
58
59
|
Provides-Extra: dev
|
59
60
|
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
60
61
|
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
@@ -62,6 +63,10 @@ Requires-Dist: black>=22.0.0; extra == "dev"
|
|
62
63
|
Requires-Dist: flake8>=5.0.0; extra == "dev"
|
63
64
|
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
64
65
|
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
|
66
|
+
Requires-Dist: build>=1.0.0; extra == "dev"
|
67
|
+
Requires-Dist: twine>=4.0.0; extra == "dev"
|
68
|
+
Requires-Dist: psutil>=5.8.0; extra == "dev"
|
69
|
+
Requires-Dist: docker>=6.0.0; extra == "dev"
|
65
70
|
Provides-Extra: test-postgresql
|
66
71
|
Requires-Dist: pytest>=7.0.0; extra == "test-postgresql"
|
67
72
|
Requires-Dist: psycopg2-binary>=2.9.0; extra == "test-postgresql"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
thoth_dbmanager/ThothDbManager.py,sha256=xyPhB6_3Ao3fGb4LjgCe-MvVI_C-9UXxeazra2dhmkI,17846
|
2
|
-
thoth_dbmanager/__init__.py,sha256=
|
2
|
+
thoth_dbmanager/__init__.py,sha256=zvs3kqKA99s9RJN6JVWTm-8asMeLc1NG5mnEpJTfzNg,3190
|
3
3
|
thoth_dbmanager/documents.py,sha256=z-f7zo_CZHqoGM0qHT8-lSUx4NhnMNZTSajpoFtRxn4,5051
|
4
|
-
thoth_dbmanager/dynamic_imports.py,sha256=
|
4
|
+
thoth_dbmanager/dynamic_imports.py,sha256=nqMmxl2KeczAK-Bi5Fq92f3rPpPsTay-Bq553iHFbWI,7507
|
5
5
|
thoth_dbmanager/adapters/__init__.py,sha256=tKIMlo9-gbH_cqnqZJ9yw1zQZKUzsV4hljDUNzcoZXg,486
|
6
6
|
thoth_dbmanager/adapters/mariadb.py,sha256=LTsf0gORiwqZkd6WtKcOsYLHyDgysxdqNesBscbJwNs,5709
|
7
7
|
thoth_dbmanager/adapters/mysql.py,sha256=TrFbxoMMNWbmUcgkKQYOIfsstmMUmuLlGB7R4ZFEIYI,5698
|
@@ -32,8 +32,8 @@ thoth_dbmanager/plugins/postgresql.py,sha256=GF6k4K0t7-Y08THWJzS0eWJkrQ1e4GfoKIc
|
|
32
32
|
thoth_dbmanager/plugins/sqlite.py,sha256=esgJqDp2aSu4a32WnmynfFyY9JfW5W8VjNTkaA-hZhM,6402
|
33
33
|
thoth_dbmanager/plugins/sqlserver.py,sha256=mMb3F5FmSWV02FZwj-Ult-2TjuyeVA4Fl1iME1dbgLU,5289
|
34
34
|
thoth_dbmanager/plugins/supabase.py,sha256=mWlaGAdpywx4-pU4Ffpmn24ze8sg0sM5kc6bFDoeYRg,8645
|
35
|
-
thoth_dbmanager-0.4.
|
36
|
-
thoth_dbmanager-0.4.
|
37
|
-
thoth_dbmanager-0.4.
|
38
|
-
thoth_dbmanager-0.4.
|
39
|
-
thoth_dbmanager-0.4.
|
35
|
+
thoth_dbmanager-0.4.3.dist-info/licenses/LICENSE,sha256=81-BOzGgwtY1XdYfkwMQB87AkOGXI9OMq0kjNcZA4UE,1071
|
36
|
+
thoth_dbmanager-0.4.3.dist-info/METADATA,sha256=5cjJw_2qjHE_Ke7gukqF0WrRQLOJGT9PSSn9SegJOoQ,12259
|
37
|
+
thoth_dbmanager-0.4.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
38
|
+
thoth_dbmanager-0.4.3.dist-info/top_level.txt,sha256=b9ttxm9RUc0KUCASEKRx6FqoREYJ1-KZWSpNuaM0uQ4,16
|
39
|
+
thoth_dbmanager-0.4.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|