thoth-dbmanager 0.5.8__tar.gz → 0.5.9__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.5.8/thoth_dbmanager.egg-info → thoth_dbmanager-0.5.9}/PKG-INFO +1 -1
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/pyproject.toml +1 -1
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/tests/test_lsh_interactive.py +13 -3
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/tests/test_thoth_db_manager_base.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/ThothDbManager.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/__init__.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/adapters/__init__.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/adapters/mariadb.py +13 -4
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/adapters/postgresql.py +49 -23
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/adapters/sqlite.py +14 -1
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/adapters/sqlserver.py +21 -3
- thoth_dbmanager-0.5.9/thoth_dbmanager/core/__init__.py +27 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/core/factory.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/core/interfaces.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/core/registry.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/documents.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/dynamic_imports.py +14 -0
- thoth_dbmanager-0.5.9/thoth_dbmanager/helpers/__init__.py +13 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/helpers/multi_db_generator.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/helpers/preprocess_values.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/helpers/schema.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/helpers/search.py +14 -0
- thoth_dbmanager-0.5.9/thoth_dbmanager/lsh/__init__.py +35 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/lsh/core.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/lsh/factory.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/lsh/manager.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/lsh/storage.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/plugins/__init__.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/plugins/mariadb.py +13 -3
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/plugins/postgresql.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/plugins/sqlite.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/plugins/sqlserver.py +14 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9/thoth_dbmanager.egg-info}/PKG-INFO +1 -1
- thoth_dbmanager-0.5.8/thoth_dbmanager/core/__init__.py +0 -13
- thoth_dbmanager-0.5.8/thoth_dbmanager/helpers/__init__.py +0 -0
- thoth_dbmanager-0.5.8/thoth_dbmanager/lsh/__init__.py +0 -21
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/LICENSE +0 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/LICENSE.md +0 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/MANIFEST.in +0 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/README.md +0 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/setup.cfg +0 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager.egg-info/SOURCES.txt +0 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager.egg-info/dependency_links.txt +0 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager.egg-info/requires.txt +0 -0
- {thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: thoth_dbmanager
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.9
|
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
|
@@ -1,6 +1,16 @@
|
|
1
|
-
# Copyright
|
2
|
-
#
|
3
|
-
#
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
4
14
|
|
5
15
|
"""
|
6
16
|
Interactive LSH search test utility.
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
import unittest
|
2
16
|
from abc import ABC
|
3
17
|
from unittest.mock import MagicMock, patch
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
import logging
|
2
16
|
from abc import ABC, abstractmethod
|
3
17
|
from pathlib import Path
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
Thoth Database Manager - A unified interface for multiple database systems.
|
3
17
|
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
Database adapters for Thoth SQL Database Manager.
|
3
17
|
"""
|
@@ -1,6 +1,16 @@
|
|
1
|
-
# Copyright
|
2
|
-
#
|
3
|
-
#
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
4
14
|
|
5
15
|
"""
|
6
16
|
MariaDB adapter implementation.
|
@@ -309,7 +319,6 @@ class MariaDBAdapter(DbAdapter):
|
|
309
319
|
|
310
320
|
if any(t in col_type for t in ['VARCHAR', 'CHAR', 'TEXT', 'INT', 'ENUM']):
|
311
321
|
try:
|
312
|
-
# Limit to first 100 unique values
|
313
322
|
query = f"SELECT DISTINCT `{col_name}` FROM `{table_name}` LIMIT 100"
|
314
323
|
result = self.execute_query(query)
|
315
324
|
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
PostgreSQL adapter implementation.
|
3
17
|
"""
|
@@ -29,6 +43,8 @@ class PostgreSQLAdapter(DbAdapter):
|
|
29
43
|
super().__init__(connection_params)
|
30
44
|
self.engine = None
|
31
45
|
self.raw_connection = None
|
46
|
+
# Schema support (default 'public')
|
47
|
+
self.schema = connection_params.get('schema', 'public')
|
32
48
|
|
33
49
|
def connect(self) -> None:
|
34
50
|
"""Establish PostgreSQL connection"""
|
@@ -129,19 +145,23 @@ class PostgreSQLAdapter(DbAdapter):
|
|
129
145
|
|
130
146
|
def get_tables_as_documents(self) -> List[TableDocument]:
|
131
147
|
"""Get tables as document objects"""
|
148
|
+
# Use pg_catalog to avoid requiring SELECT privileges on tables
|
149
|
+
# relkind: 'r' = ordinary table, 'p' = partitioned table
|
132
150
|
query = """
|
133
151
|
SELECT
|
134
|
-
|
135
|
-
|
136
|
-
COALESCE(
|
137
|
-
FROM
|
138
|
-
|
139
|
-
LEFT JOIN
|
140
|
-
WHERE
|
141
|
-
|
152
|
+
n.nspname AS schema_name,
|
153
|
+
c.relname AS table_name,
|
154
|
+
COALESCE(d.description, '') AS comment
|
155
|
+
FROM pg_class c
|
156
|
+
JOIN pg_namespace n ON n.oid = c.relnamespace
|
157
|
+
LEFT JOIN pg_description d ON d.objoid = c.oid AND d.objsubid = 0
|
158
|
+
WHERE c.relkind IN ('r','p')
|
159
|
+
AND n.nspname = :schema
|
160
|
+
AND n.nspname NOT IN ('pg_catalog','information_schema','pg_toast')
|
161
|
+
ORDER BY c.relname
|
142
162
|
"""
|
143
163
|
|
144
|
-
results = self.execute_query(query)
|
164
|
+
results = self.execute_query(query, {"schema": self.schema})
|
145
165
|
documents = []
|
146
166
|
|
147
167
|
for row in results:
|
@@ -179,10 +199,11 @@ class PostgreSQLAdapter(DbAdapter):
|
|
179
199
|
) pk ON pk.column_name = c.column_name AND pk.table_name = c.table_name AND pk.table_schema = c.table_schema
|
180
200
|
WHERE c.table_name = :table_name
|
181
201
|
AND c.table_schema NOT IN ('information_schema', 'pg_catalog')
|
202
|
+
AND c.table_schema = :schema
|
182
203
|
ORDER BY c.ordinal_position
|
183
204
|
"""
|
184
205
|
|
185
|
-
results = self.execute_query(query, {"table_name": table_name})
|
206
|
+
results = self.execute_query(query, {"table_name": table_name, "schema": self.schema})
|
186
207
|
documents = []
|
187
208
|
|
188
209
|
for row in results:
|
@@ -205,21 +226,26 @@ class PostgreSQLAdapter(DbAdapter):
|
|
205
226
|
"""Get foreign keys as document objects"""
|
206
227
|
query = """
|
207
228
|
SELECT
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
FROM
|
215
|
-
JOIN
|
216
|
-
JOIN
|
217
|
-
|
218
|
-
|
219
|
-
|
229
|
+
con.conname AS constraint_name,
|
230
|
+
ns.nspname AS schema_name,
|
231
|
+
rel.relname AS source_table,
|
232
|
+
a.attname AS source_column,
|
233
|
+
frel.relname AS target_table,
|
234
|
+
fa.attname AS target_column
|
235
|
+
FROM pg_constraint con
|
236
|
+
JOIN pg_class rel ON rel.oid = con.conrelid
|
237
|
+
JOIN pg_namespace ns ON ns.oid = rel.relnamespace
|
238
|
+
JOIN pg_class frel ON frel.oid = con.confrelid
|
239
|
+
JOIN unnest(con.conkey) WITH ORDINALITY AS src(attnum, ord) ON true
|
240
|
+
JOIN pg_attribute a ON a.attrelid = con.conrelid AND a.attnum = src.attnum
|
241
|
+
JOIN unnest(con.confkey) WITH ORDINALITY AS dst(attnum, ord) ON dst.ord = src.ord
|
242
|
+
JOIN pg_attribute fa ON fa.attrelid = con.confrelid AND fa.attnum = dst.attnum
|
243
|
+
WHERE con.contype = 'f'
|
244
|
+
AND ns.nspname = :schema
|
245
|
+
ORDER BY ns.nspname, rel.relname, src.ord
|
220
246
|
"""
|
221
247
|
|
222
|
-
results = self.execute_query(query)
|
248
|
+
results = self.execute_query(query, {"schema": self.schema})
|
223
249
|
documents = []
|
224
250
|
|
225
251
|
for row in results:
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
SQLite adapter implementation.
|
3
17
|
"""
|
@@ -206,7 +220,6 @@ class SQLiteAdapter(DbAdapter):
|
|
206
220
|
|
207
221
|
def get_schemas_as_documents(self) -> List[SchemaDocument]:
|
208
222
|
"""Get schemas as document objects"""
|
209
|
-
# SQLite has limited schema support, mainly 'main', 'temp', and attached databases
|
210
223
|
query = "PRAGMA database_list"
|
211
224
|
|
212
225
|
results = self.execute_query(query)
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
SQL Server adapter implementation.
|
3
17
|
"""
|
@@ -456,7 +470,7 @@ class SQLServerAdapter(DbAdapter):
|
|
456
470
|
raise RuntimeError("Not connected to database")
|
457
471
|
|
458
472
|
if table_name:
|
459
|
-
where_clause = f"
|
473
|
+
where_clause = f"AND t.name = '{table_name}'"
|
460
474
|
else:
|
461
475
|
where_clause = ""
|
462
476
|
|
@@ -472,6 +486,8 @@ class SQLServerAdapter(DbAdapter):
|
|
472
486
|
JOIN sys.columns c ON fkc.parent_object_id = c.object_id AND fkc.parent_column_id = c.column_id
|
473
487
|
JOIN sys.columns rc ON fkc.referenced_object_id = rc.object_id AND fkc.referenced_column_id = rc.column_id
|
474
488
|
JOIN sys.tables t ON fk.parent_object_id = t.object_id
|
489
|
+
JOIN sys.schemas s ON t.schema_id = s.schema_id
|
490
|
+
WHERE s.name = '{self.schema}'
|
475
491
|
{where_clause}
|
476
492
|
ORDER BY fk.name
|
477
493
|
"""
|
@@ -514,7 +530,7 @@ class SQLServerAdapter(DbAdapter):
|
|
514
530
|
raise RuntimeError("Not connected to database")
|
515
531
|
|
516
532
|
if table_name:
|
517
|
-
where_clause = f"
|
533
|
+
where_clause = f"AND t.name = '{table_name}'"
|
518
534
|
else:
|
519
535
|
where_clause = ""
|
520
536
|
|
@@ -529,8 +545,10 @@ class SQLServerAdapter(DbAdapter):
|
|
529
545
|
JOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id
|
530
546
|
JOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id
|
531
547
|
JOIN sys.tables t ON i.object_id = t.object_id
|
548
|
+
JOIN sys.schemas s ON t.schema_id = s.schema_id
|
549
|
+
WHERE s.name = '{self.schema}'
|
532
550
|
{where_clause}
|
533
|
-
|
551
|
+
AND i.name IS NOT NULL
|
534
552
|
ORDER BY i.name, ic.key_ordinal
|
535
553
|
"""
|
536
554
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
"""
|
16
|
+
Core components for Thoth SQL Database Manager.
|
17
|
+
"""
|
18
|
+
from .interfaces import DbPlugin, DbAdapter
|
19
|
+
from .registry import DbPluginRegistry
|
20
|
+
from .factory import ThothDbFactory
|
21
|
+
|
22
|
+
__all__ = [
|
23
|
+
"DbPlugin",
|
24
|
+
"DbAdapter",
|
25
|
+
"DbPluginRegistry",
|
26
|
+
"ThothDbFactory",
|
27
|
+
]
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
Factory for creating database manager instances with plugin support.
|
3
17
|
"""
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
Abstract interfaces for database plugins and adapters.
|
3
17
|
"""
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
Plugin registry system for database plugins.
|
3
17
|
"""
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
Document models for Thoth SQL Database Manager.
|
3
17
|
Provides type-safe document structures similar to thoth_vdb architecture.
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
Dynamic import system for database-specific functionality.
|
3
17
|
This module provides lazy loading of database managers and adapters.
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
{thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/helpers/multi_db_generator.py
RENAMED
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
import logging
|
2
16
|
import random
|
3
17
|
import re
|
{thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager/helpers/preprocess_values.py
RENAMED
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
import logging
|
2
16
|
import pickle
|
3
17
|
from pathlib import Path
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
import logging
|
2
16
|
from dataclasses import dataclass, field
|
3
17
|
from typing import Any, Dict, List, Optional, Tuple
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
import logging
|
2
16
|
import pickle
|
3
17
|
from pathlib import Path
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
"""
|
16
|
+
LSH (Locality Sensitive Hashing) module for database-independent LSH management.
|
17
|
+
"""
|
18
|
+
|
19
|
+
from .storage import LshStorageStrategy, PickleStorage
|
20
|
+
from .manager import LshManager
|
21
|
+
from .factory import LshFactory, make_db_lsh
|
22
|
+
from .core import create_minhash, skip_column, jaccard_similarity, create_lsh_index, query_lsh_index
|
23
|
+
|
24
|
+
__all__ = [
|
25
|
+
"LshStorageStrategy",
|
26
|
+
"PickleStorage",
|
27
|
+
"LshManager",
|
28
|
+
"LshFactory",
|
29
|
+
"make_db_lsh",
|
30
|
+
"create_minhash",
|
31
|
+
"skip_column",
|
32
|
+
"jaccard_similarity",
|
33
|
+
"create_lsh_index",
|
34
|
+
"query_lsh_index"
|
35
|
+
]
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
Core LSH functionality extracted from helpers.
|
3
17
|
"""
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
Factory for creating LSH indices from database managers.
|
3
17
|
"""
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
LSH Manager for database-independent LSH operations.
|
3
17
|
"""
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
Storage strategies for LSH data persistence.
|
3
17
|
"""
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
Database plugins for Thoth SQL Database Manager.
|
3
17
|
"""
|
@@ -1,6 +1,16 @@
|
|
1
|
-
# Copyright
|
2
|
-
#
|
3
|
-
#
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
4
14
|
|
5
15
|
"""
|
6
16
|
MariaDB plugin for Thoth SQL Database Manager.
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
PostgreSQL plugin implementation.
|
3
17
|
"""
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
SQLite plugin implementation.
|
3
17
|
"""
|
@@ -1,3 +1,17 @@
|
|
1
|
+
# Copyright 2025 Marco Pancotti
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
1
15
|
"""
|
2
16
|
SQL Server plugin implementation.
|
3
17
|
"""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: thoth_dbmanager
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.9
|
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
|
@@ -1,13 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Core components for Thoth SQL Database Manager.
|
3
|
-
"""
|
4
|
-
from .interfaces import DbPlugin, DbAdapter
|
5
|
-
from .registry import DbPluginRegistry
|
6
|
-
from .factory import ThothDbFactory
|
7
|
-
|
8
|
-
__all__ = [
|
9
|
-
"DbPlugin",
|
10
|
-
"DbAdapter",
|
11
|
-
"DbPluginRegistry",
|
12
|
-
"ThothDbFactory",
|
13
|
-
]
|
File without changes
|
@@ -1,21 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
LSH (Locality Sensitive Hashing) module for database-independent LSH management.
|
3
|
-
"""
|
4
|
-
|
5
|
-
from .storage import LshStorageStrategy, PickleStorage
|
6
|
-
from .manager import LshManager
|
7
|
-
from .factory import LshFactory, make_db_lsh
|
8
|
-
from .core import create_minhash, skip_column, jaccard_similarity, create_lsh_index, query_lsh_index
|
9
|
-
|
10
|
-
__all__ = [
|
11
|
-
"LshStorageStrategy",
|
12
|
-
"PickleStorage",
|
13
|
-
"LshManager",
|
14
|
-
"LshFactory",
|
15
|
-
"make_db_lsh",
|
16
|
-
"create_minhash",
|
17
|
-
"skip_column",
|
18
|
-
"jaccard_similarity",
|
19
|
-
"create_lsh_index",
|
20
|
-
"query_lsh_index"
|
21
|
-
]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{thoth_dbmanager-0.5.8 → thoth_dbmanager-0.5.9}/thoth_dbmanager.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|