thoth-dbmanager 0.5.8__py3-none-any.whl → 0.5.10__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.
Files changed (35) hide show
  1. thoth_dbmanager/ThothDbManager.py +14 -0
  2. thoth_dbmanager/__init__.py +14 -0
  3. thoth_dbmanager/adapters/__init__.py +14 -0
  4. thoth_dbmanager/adapters/mariadb.py +13 -4
  5. thoth_dbmanager/adapters/postgresql.py +75 -49
  6. thoth_dbmanager/adapters/sqlite.py +14 -1
  7. thoth_dbmanager/adapters/sqlserver.py +21 -3
  8. thoth_dbmanager/core/__init__.py +14 -0
  9. thoth_dbmanager/core/factory.py +14 -0
  10. thoth_dbmanager/core/interfaces.py +14 -0
  11. thoth_dbmanager/core/registry.py +14 -0
  12. thoth_dbmanager/documents.py +14 -0
  13. thoth_dbmanager/dynamic_imports.py +14 -0
  14. thoth_dbmanager/helpers/__init__.py +13 -0
  15. thoth_dbmanager/helpers/multi_db_generator.py +14 -0
  16. thoth_dbmanager/helpers/preprocess_values.py +14 -0
  17. thoth_dbmanager/helpers/schema.py +14 -0
  18. thoth_dbmanager/helpers/search.py +14 -0
  19. thoth_dbmanager/lsh/__init__.py +14 -0
  20. thoth_dbmanager/lsh/core.py +14 -0
  21. thoth_dbmanager/lsh/factory.py +14 -0
  22. thoth_dbmanager/lsh/manager.py +14 -0
  23. thoth_dbmanager/lsh/storage.py +14 -0
  24. thoth_dbmanager/plugins/__init__.py +14 -0
  25. thoth_dbmanager/plugins/mariadb.py +13 -3
  26. thoth_dbmanager/plugins/postgresql.py +14 -0
  27. thoth_dbmanager/plugins/sqlite.py +14 -0
  28. thoth_dbmanager/plugins/sqlserver.py +14 -0
  29. {thoth_dbmanager-0.5.8.dist-info → thoth_dbmanager-0.5.10.dist-info}/METADATA +1 -1
  30. thoth_dbmanager-0.5.10.dist-info/RECORD +34 -0
  31. thoth_dbmanager-0.5.8.dist-info/RECORD +0 -34
  32. {thoth_dbmanager-0.5.8.dist-info → thoth_dbmanager-0.5.10.dist-info}/WHEEL +0 -0
  33. {thoth_dbmanager-0.5.8.dist-info → thoth_dbmanager-0.5.10.dist-info}/licenses/LICENSE +0 -0
  34. {thoth_dbmanager-0.5.8.dist-info → thoth_dbmanager-0.5.10.dist-info}/licenses/LICENSE.md +0 -0
  35. {thoth_dbmanager-0.5.8.dist-info → thoth_dbmanager-0.5.10.dist-info}/top_level.txt +0 -0
@@ -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 (c) 2025 Marco Pancotti
2
- # This file is part of Thoth and is released under the MIT License.
3
- # See the LICENSE.md file in the project root for full license information.
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
- schemaname as schema_name,
135
- tablename as table_name,
136
- COALESCE(obj_description(c.oid), '') as comment
137
- FROM pg_tables pt
138
- LEFT JOIN pg_class c ON c.relname = pt.tablename
139
- LEFT JOIN pg_namespace n ON n.oid = c.relnamespace AND n.nspname = pt.schemaname
140
- WHERE schemaname NOT IN ('information_schema', 'pg_catalog', 'pg_toast')
141
- ORDER BY schemaname, tablename
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:
@@ -156,33 +176,34 @@ class PostgreSQLAdapter(DbAdapter):
156
176
 
157
177
 
158
178
  def get_columns_as_documents(self, table_name: str) -> List[ColumnDocument]:
159
- """Get columns as document objects"""
179
+ """Get columns as document objects using pg_catalog to avoid SELECT restrictions"""
160
180
  query = """
161
- SELECT
162
- c.column_name,
163
- c.data_type,
164
- c.is_nullable,
165
- c.column_default,
166
- c.character_maximum_length,
167
- COALESCE(pgd.description, '') as comment,
168
- CASE WHEN pk.column_name IS NOT NULL THEN true ELSE false END as is_pk,
169
- c.table_schema as schema_name
170
- FROM information_schema.columns c
171
- LEFT JOIN pg_class pgc ON pgc.relname = c.table_name
172
- LEFT JOIN pg_namespace pgn ON pgn.oid = pgc.relnamespace AND pgn.nspname = c.table_schema
173
- LEFT JOIN pg_description pgd ON pgd.objoid = pgc.oid AND pgd.objsubid = c.ordinal_position
174
- LEFT JOIN (
175
- SELECT ku.column_name, ku.table_name, ku.table_schema
176
- FROM information_schema.table_constraints tc
177
- JOIN information_schema.key_column_usage ku ON tc.constraint_name = ku.constraint_name
178
- WHERE tc.constraint_type = 'PRIMARY KEY'
179
- ) pk ON pk.column_name = c.column_name AND pk.table_name = c.table_name AND pk.table_schema = c.table_schema
180
- WHERE c.table_name = :table_name
181
- AND c.table_schema NOT IN ('information_schema', 'pg_catalog')
182
- ORDER BY c.ordinal_position
181
+ SELECT
182
+ a.attname AS column_name,
183
+ format_type(a.atttypid, a.atttypmod) AS data_type,
184
+ (NOT a.attnotnull) AS is_nullable,
185
+ pg_get_expr(d.adbin, d.adrelid) AS column_default,
186
+ NULL::int AS character_maximum_length,
187
+ COALESCE(pgd.description, '') AS comment,
188
+ EXISTS (
189
+ SELECT 1
190
+ FROM pg_index i
191
+ WHERE i.indrelid = c.oid AND i.indisprimary AND a.attnum = ANY(i.indkey)
192
+ ) AS is_pk,
193
+ n.nspname AS schema_name
194
+ FROM pg_class c
195
+ JOIN pg_namespace n ON n.oid = c.relnamespace
196
+ JOIN pg_attribute a ON a.attrelid = c.oid
197
+ LEFT JOIN pg_attrdef d ON d.adrelid = c.oid AND d.adnum = a.attnum
198
+ LEFT JOIN pg_description pgd ON pgd.objoid = c.oid AND pgd.objsubid = a.attnum
199
+ WHERE c.relname = :table_name
200
+ AND n.nspname = :schema
201
+ AND a.attnum > 0
202
+ AND NOT a.attisdropped
203
+ ORDER BY a.attnum
183
204
  """
184
-
185
- results = self.execute_query(query, {"table_name": table_name})
205
+
206
+ results = self.execute_query(query, {"table_name": table_name, "schema": self.schema})
186
207
  documents = []
187
208
 
188
209
  for row in results:
@@ -191,8 +212,8 @@ class PostgreSQLAdapter(DbAdapter):
191
212
  column_name=row.column_name,
192
213
  data_type=row.data_type,
193
214
  comment=row.comment or "",
194
- is_pk=row.is_pk,
195
- is_nullable=row.is_nullable == 'YES',
215
+ is_pk=bool(row.is_pk),
216
+ is_nullable=bool(row.is_nullable),
196
217
  default_value=row.column_default,
197
218
  max_length=row.character_maximum_length,
198
219
  schema_name=row.schema_name
@@ -205,21 +226,26 @@ class PostgreSQLAdapter(DbAdapter):
205
226
  """Get foreign keys as document objects"""
206
227
  query = """
207
228
  SELECT
208
- tc.constraint_name,
209
- tc.table_schema as schema_name,
210
- tc.table_name as source_table,
211
- kcu.column_name as source_column,
212
- ccu.table_name as target_table,
213
- ccu.column_name as target_column
214
- FROM information_schema.table_constraints tc
215
- JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name
216
- JOIN information_schema.constraint_column_usage ccu ON ccu.constraint_name = tc.constraint_name
217
- WHERE tc.constraint_type = 'FOREIGN KEY'
218
- AND tc.table_schema NOT IN ('information_schema', 'pg_catalog')
219
- ORDER BY tc.table_schema, tc.table_name, kcu.ordinal_position
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"WHERE t.name = '{table_name}'"
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"WHERE t.name = '{table_name}'"
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
- WHERE i.name IS NOT NULL
551
+ AND i.name IS NOT NULL
534
552
  ORDER BY i.name, ic.key_ordinal
535
553
  """
536
554
 
@@ -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 components for Thoth SQL Database Manager.
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 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.
@@ -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
@@ -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
@@ -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 (Locality Sensitive Hashing) module for database-independent LSH management.
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
  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 (c) 2025 Marco Pancotti
2
- # This file is part of Thoth and is released under the MIT License.
3
- # See the LICENSE.md file in the project root for full license information.
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.8
3
+ Version: 0.5.10
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
@@ -0,0 +1,34 @@
1
+ thoth_dbmanager/ThothDbManager.py,sha256=Mt3MCvV7vVPgS2jXuyGJVMLslKRpbhxmTCeHL6s80XA,9522
2
+ thoth_dbmanager/__init__.py,sha256=7TpqAsZhwGyr3tA_oyGbAOaVhd7k6Ta3wGQTK7mdUpE,2234
3
+ thoth_dbmanager/documents.py,sha256=BnYL9MR9eOl9cNOrY58SgHgXACnHCk_UzKjpfV8RjgY,5630
4
+ thoth_dbmanager/dynamic_imports.py,sha256=nKCwg3Y2e5f4oP_-9X53t4Z9InbIGDMgidQjeN1Xgoo,7592
5
+ thoth_dbmanager/adapters/__init__.py,sha256=rfXo8IxWPx2TQV2OwFrZqpOzrkKuO6HR0q8ftkuGhW0,1578
6
+ thoth_dbmanager/adapters/mariadb.py,sha256=Bc31B4LNzlqu1QwhBP49Ia1jlh-XWh14Q_ya-KqWvsQ,15636
7
+ thoth_dbmanager/adapters/postgresql.py,sha256=xUu5_U6guDx27DH6G4txADfQCp0EOuWPxkFgnnRQGJI,18259
8
+ thoth_dbmanager/adapters/sqlite.py,sha256=sg9ifwBL3L_aBf6i3Z0wq_Z7mTjnVeWhCY1VK6Cfh9E,15147
9
+ thoth_dbmanager/adapters/sqlserver.py,sha256=VcWW5xudK4_3BuPwX0WcBAxgN6j9seRssvwsWPpJudo,25320
10
+ thoth_dbmanager/core/__init__.py,sha256=22dsupbGskkjGgS9IzeCwaf5o7nIKH_og1qARZURAFM,848
11
+ thoth_dbmanager/core/factory.py,sha256=4RHiAlqTGbtMKGCboDM8dnCgyJhO4PTWgkGyJ-ZSrFc,9537
12
+ thoth_dbmanager/core/interfaces.py,sha256=SAmPllSyJamLb8eyN9CdpnunNxje6M-q1SrR3hxTAE4,10154
13
+ thoth_dbmanager/core/registry.py,sha256=0yqZGs2zVoX601pr4Sct1LITt1O87IG4Yyhay8EpNg0,9203
14
+ thoth_dbmanager/helpers/__init__.py,sha256=4URWmUXMDcn9N4Jd-1vGA93MG6TOhTF55wVC0nBpPIw,578
15
+ thoth_dbmanager/helpers/multi_db_generator.py,sha256=qoSJA-xfUEPyFgKLcJDJUAkcvTxRG-IJzHHi05a6Tpc,23817
16
+ thoth_dbmanager/helpers/preprocess_values.py,sha256=fuRebc34DvE6OSZztCG8iJDFu2W6_mXpYvymoP0s_LU,6762
17
+ thoth_dbmanager/helpers/schema.py,sha256=9zmQXZYPpWErYxhKiGjw84iqi2R1bfuULzEdxuzZhrI,14557
18
+ thoth_dbmanager/helpers/search.py,sha256=pN-GNKA25jAFrspEyZoLI9pw4VKGC75nABeUEwIrVQQ,4549
19
+ thoth_dbmanager/lsh/__init__.py,sha256=nOCWWb4FUJ3ukggaTdPA2AOZI3m3iu54OKschnqxThc,1134
20
+ thoth_dbmanager/lsh/core.py,sha256=eqeqHvOiHcEiwt0xxInn5iQT7rOX2Chl_tWBBNq1Stw,7392
21
+ thoth_dbmanager/lsh/factory.py,sha256=jf-_0VXOHsCdgKb8KgWDMSQk9TpTg6KbpPXc0Mn_Lqc,2990
22
+ thoth_dbmanager/lsh/manager.py,sha256=mHdgVgkOhVcJvu0ED0qgHmZKp28er6avx2MZzTOJCSQ,7092
23
+ thoth_dbmanager/lsh/storage.py,sha256=ijryQWavoPAQ7tRGvjc-2dBJmI7mzNGUa1dSR_ke6Vw,5122
24
+ thoth_dbmanager/plugins/__init__.py,sha256=uTGI4GZNE6xSEfzuf_7llqGHY5D1BbC2EMJjgKXU-xM,1736
25
+ thoth_dbmanager/plugins/mariadb.py,sha256=OW_u_x3mfaQYH5dUEreUbelPE6KEQU4kiqT3_DzHgUg,8610
26
+ thoth_dbmanager/plugins/postgresql.py,sha256=VFGiGa1qAWRR00DkoHIAFS-U9uMLMwb5gKa_NB-cQA8,6097
27
+ thoth_dbmanager/plugins/sqlite.py,sha256=yqqa_lToLabOv_ut2uRTXxhjyEQSVbB8kIcUwy7HNZk,9436
28
+ thoth_dbmanager/plugins/sqlserver.py,sha256=AxEXwe21FRh6L1lX6-gu3VzcxDQ7dO5YLvLXTrIyaRk,5868
29
+ thoth_dbmanager-0.5.10.dist-info/licenses/LICENSE,sha256=81-BOzGgwtY1XdYfkwMQB87AkOGXI9OMq0kjNcZA4UE,1071
30
+ thoth_dbmanager-0.5.10.dist-info/licenses/LICENSE.md,sha256=TtKT2ej3GRki3W8FmSeYzRuQtZ1oMGWchpWykZ4vA7c,1070
31
+ thoth_dbmanager-0.5.10.dist-info/METADATA,sha256=AGjfF7xBRTDs8SnHzND6VuFvRCzUav0cjaiV2Tdw7r4,14778
32
+ thoth_dbmanager-0.5.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
33
+ thoth_dbmanager-0.5.10.dist-info/top_level.txt,sha256=b9ttxm9RUc0KUCASEKRx6FqoREYJ1-KZWSpNuaM0uQ4,16
34
+ thoth_dbmanager-0.5.10.dist-info/RECORD,,
@@ -1,34 +0,0 @@
1
- thoth_dbmanager/ThothDbManager.py,sha256=q-jctgt3MJCDFzq6icQdP1oLeVy1ypg402F4ybxhG8c,8943
2
- thoth_dbmanager/__init__.py,sha256=tsW5bAgsXd4m2bZmcQZ5G8NHoSg-F4h1tiXwpXFAFXs,1655
3
- thoth_dbmanager/documents.py,sha256=z-f7zo_CZHqoGM0qHT8-lSUx4NhnMNZTSajpoFtRxn4,5051
4
- thoth_dbmanager/dynamic_imports.py,sha256=xDahgiqKvwSYqjPgHiQqD1XPhAbM_JqnU3OhBp2N-fc,7013
5
- thoth_dbmanager/adapters/__init__.py,sha256=5q15dASHBVqsoNj-l1t371VtfuBjhxDAhW68COYI6QI,999
6
- thoth_dbmanager/adapters/mariadb.py,sha256=PkFHUDism4X_P5W26NDsxdK2T_rmKlPHdwALOXWMExY,15301
7
- thoth_dbmanager/adapters/postgresql.py,sha256=qxdlxOV7Nvn8U4Lhat50w87Z2S8AzBfmLfEwKfz7dis,17299
8
- thoth_dbmanager/adapters/sqlite.py,sha256=RTDszgnAtkE14LKFeoe9lBHgsqXqkmDk6jDCTmVpnoM,14659
9
- thoth_dbmanager/adapters/sqlserver.py,sha256=7RGZ3qQTJCfVyvjOj4jQ9G2NAD9vtmzcho4Dbi3is_o,24557
10
- thoth_dbmanager/core/__init__.py,sha256=FlqNW0GZNv1rnwNgyXGzveLqaw0Z90y5AKhR_1DvHBE,269
11
- thoth_dbmanager/core/factory.py,sha256=zPqyo2kVPvSsjKrzfyg5rEwqKpay6RmymQ1NZr15Onw,8958
12
- thoth_dbmanager/core/interfaces.py,sha256=s6t-8w4QWu_4Dl654LAU2p3Ao34wjeNaGEsUOJwYHaM,9575
13
- thoth_dbmanager/core/registry.py,sha256=url4qpQMoMw4rDrdAAvV6L7-NdO4z86xSJPSwTH_l5g,8624
14
- thoth_dbmanager/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- thoth_dbmanager/helpers/multi_db_generator.py,sha256=frN0SZtWAfeojoJFLs4XLR3ri6h9pHYc-2O4aLAOlbo,23238
16
- thoth_dbmanager/helpers/preprocess_values.py,sha256=sKMjD50UL2CZG7-g7KGe3TJQeXmXC7n28LGge8CaP5c,6183
17
- thoth_dbmanager/helpers/schema.py,sha256=PhHgUxfFe7qUPxdpWQ3YfS593VQjyKtaSKMlChCyLNo,13978
18
- thoth_dbmanager/helpers/search.py,sha256=k04L7clSPfeQOlq_ifsH3PZ21ZK-rujh_Qy4hWrvSso,3970
19
- thoth_dbmanager/lsh/__init__.py,sha256=zAUTRuRX4MNc2nU93tTBkT2_IVL7OBkBL0WZPPgO3Ec,555
20
- thoth_dbmanager/lsh/core.py,sha256=171FqHW7ItAqAPk6g_AoayKTE3Bs1rRZxnt55MJVzjY,6813
21
- thoth_dbmanager/lsh/factory.py,sha256=2Bpkk-OygjaptZAw1yysxO1cxG3QTxmJ1yFGcXHqX3w,2411
22
- thoth_dbmanager/lsh/manager.py,sha256=LGrKbGKiBuISlNXaU4Yxfc_BqJfN27MaXapJbzEAjJQ,6513
23
- thoth_dbmanager/lsh/storage.py,sha256=qei6fwpmRCBSS8CRtDlnZCuWEmyuOK9gVSTkEJdX0eI,4543
24
- thoth_dbmanager/plugins/__init__.py,sha256=J_ojrJNK1_xeAXbmk8UdiYfqG9vCoD6OI99QxajFM3E,1157
25
- thoth_dbmanager/plugins/mariadb.py,sha256=p4ey4_bfgAogLaM9lWgvFiWNrX-tElKSnnT0t6o-xo0,8212
26
- thoth_dbmanager/plugins/postgresql.py,sha256=pI1W9oHpQty8tHMoEDcsOT-Msv6S4aoFcArOGFxLR7Q,5518
27
- thoth_dbmanager/plugins/sqlite.py,sha256=gkgZ6-Vjkab0IP3ffHOg4bbpDHsjO_N4DesUnSDNAmQ,8857
28
- thoth_dbmanager/plugins/sqlserver.py,sha256=mMb3F5FmSWV02FZwj-Ult-2TjuyeVA4Fl1iME1dbgLU,5289
29
- thoth_dbmanager-0.5.8.dist-info/licenses/LICENSE,sha256=81-BOzGgwtY1XdYfkwMQB87AkOGXI9OMq0kjNcZA4UE,1071
30
- thoth_dbmanager-0.5.8.dist-info/licenses/LICENSE.md,sha256=TtKT2ej3GRki3W8FmSeYzRuQtZ1oMGWchpWykZ4vA7c,1070
31
- thoth_dbmanager-0.5.8.dist-info/METADATA,sha256=clF9gFLahTJJX9HxDYK8kiZgAsgKwoHwjV0qvhpdmOY,14777
32
- thoth_dbmanager-0.5.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
33
- thoth_dbmanager-0.5.8.dist-info/top_level.txt,sha256=b9ttxm9RUc0KUCASEKRx6FqoREYJ1-KZWSpNuaM0uQ4,16
34
- thoth_dbmanager-0.5.8.dist-info/RECORD,,