thoth-dbmanager 0.5.0__tar.gz → 0.5.2__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.0/thoth_dbmanager.egg-info → thoth_dbmanager-0.5.2}/PKG-INFO +232 -26
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/README.md +219 -5
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/pyproject.toml +10 -14
- thoth_dbmanager-0.5.2/tests/test_lsh_interactive.py +298 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/adapters/__init__.py +0 -6
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/core/factory.py +0 -16
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/core/interfaces.py +81 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/dynamic_imports.py +0 -9
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/plugins/__init__.py +0 -6
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/plugins/sqlite.py +1 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2/thoth_dbmanager.egg-info}/PKG-INFO +232 -26
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager.egg-info/SOURCES.txt +2 -7
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager.egg-info/requires.txt +12 -20
- thoth_dbmanager-0.5.0/thoth_dbmanager/adapters/mysql.py +0 -165
- thoth_dbmanager-0.5.0/thoth_dbmanager/adapters/oracle.py +0 -554
- thoth_dbmanager-0.5.0/thoth_dbmanager/adapters/supabase.py +0 -249
- thoth_dbmanager-0.5.0/thoth_dbmanager/plugins/mysql.py +0 -408
- thoth_dbmanager-0.5.0/thoth_dbmanager/plugins/oracle.py +0 -150
- thoth_dbmanager-0.5.0/thoth_dbmanager/plugins/supabase.py +0 -224
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/LICENSE +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/MANIFEST.in +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/setup.cfg +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/tests/test_thoth_db_manager_base.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/ThothDbManager.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/__init__.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/adapters/mariadb.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/adapters/postgresql.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/adapters/sqlite.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/adapters/sqlserver.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/core/__init__.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/core/registry.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/documents.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/helpers/__init__.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/helpers/multi_db_generator.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/helpers/preprocess_values.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/helpers/schema.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/helpers/search.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/lsh/__init__.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/lsh/core.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/lsh/factory.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/lsh/manager.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/lsh/storage.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/plugins/mariadb.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/plugins/postgresql.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager/plugins/sqlserver.py +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/thoth_dbmanager.egg-info/dependency_links.txt +0 -0
- {thoth_dbmanager-0.5.0 → thoth_dbmanager-0.5.2}/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.2
|
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
|
@@ -9,7 +9,6 @@ Project-URL: Documentation, https://github.com/mptyl/thoth_dbmanager#readme
|
|
9
9
|
Project-URL: Source Code, https://github.com/mptyl/thoth_dbmanager
|
10
10
|
Keywords: database,sql,lsh,similarity-search,orm
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
12
|
-
Classifier: Programming Language :: Python :: 3.8
|
13
12
|
Classifier: Programming Language :: Python :: 3.9
|
14
13
|
Classifier: Programming Language :: Python :: 3.10
|
15
14
|
Classifier: Programming Language :: Python :: 3.11
|
@@ -20,7 +19,7 @@ Classifier: Intended Audience :: Developers
|
|
20
19
|
Classifier: Topic :: Database
|
21
20
|
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
22
21
|
Classifier: Development Status :: 4 - Beta
|
23
|
-
Requires-Python: >=3.
|
22
|
+
Requires-Python: >=3.9
|
24
23
|
Description-Content-Type: text/markdown
|
25
24
|
License-File: LICENSE
|
26
25
|
Requires-Dist: datasketch>=1.5.0
|
@@ -31,30 +30,20 @@ Requires-Dist: pandas>=1.3.0
|
|
31
30
|
Requires-Dist: requests>=2.25.0
|
32
31
|
Provides-Extra: postgresql
|
33
32
|
Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgresql"
|
34
|
-
Provides-Extra: mysql
|
35
|
-
Requires-Dist: mysql-connector-python>=8.0.0; extra == "mysql"
|
36
33
|
Provides-Extra: mariadb
|
37
34
|
Requires-Dist: mariadb>=1.1.0; extra == "mariadb"
|
38
35
|
Provides-Extra: sqlserver
|
39
36
|
Requires-Dist: pyodbc>=4.0.0; extra == "sqlserver"
|
40
|
-
Requires-Dist: pymssql>=2.3.0; extra == "sqlserver"
|
41
|
-
Provides-Extra: oracle
|
42
|
-
Requires-Dist: cx_Oracle>=8.3.0; extra == "oracle"
|
43
|
-
Requires-Dist: oracledb>=3.0.0; extra == "oracle"
|
44
|
-
Provides-Extra: supabase
|
45
|
-
Requires-Dist: supabase>=2.0.0; extra == "supabase"
|
46
|
-
Requires-Dist: postgrest-py>=0.10.0; extra == "supabase"
|
47
|
-
Requires-Dist: gotrue>=1.0.0; extra == "supabase"
|
48
37
|
Provides-Extra: sqlite
|
38
|
+
Provides-Extra: embeddings
|
39
|
+
Requires-Dist: sentence-transformers>=2.0.0; extra == "embeddings"
|
40
|
+
Requires-Dist: numpy>=1.21.0; extra == "embeddings"
|
49
41
|
Provides-Extra: all
|
50
42
|
Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
|
51
|
-
Requires-Dist: mysql-connector-python>=8.0.0; extra == "all"
|
52
43
|
Requires-Dist: mariadb>=1.1.0; extra == "all"
|
53
44
|
Requires-Dist: pyodbc>=4.0.0; extra == "all"
|
54
|
-
Requires-Dist:
|
55
|
-
Requires-Dist:
|
56
|
-
Requires-Dist: oracledb>=3.0.0; extra == "all"
|
57
|
-
Requires-Dist: supabase>=2.0.0; extra == "all"
|
45
|
+
Requires-Dist: sentence-transformers>=2.0.0; extra == "all"
|
46
|
+
Requires-Dist: numpy>=1.21.0; extra == "all"
|
58
47
|
Provides-Extra: dev
|
59
48
|
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
60
49
|
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
@@ -69,9 +58,12 @@ Requires-Dist: docker>=6.0.0; extra == "dev"
|
|
69
58
|
Provides-Extra: test-postgresql
|
70
59
|
Requires-Dist: pytest>=7.0.0; extra == "test-postgresql"
|
71
60
|
Requires-Dist: psycopg2-binary>=2.9.0; extra == "test-postgresql"
|
72
|
-
Provides-Extra: test-
|
73
|
-
Requires-Dist: pytest>=7.0.0; extra == "test-
|
74
|
-
Requires-Dist:
|
61
|
+
Provides-Extra: test-mariadb
|
62
|
+
Requires-Dist: pytest>=7.0.0; extra == "test-mariadb"
|
63
|
+
Requires-Dist: mariadb>=1.1.0; extra == "test-mariadb"
|
64
|
+
Provides-Extra: test-sqlserver
|
65
|
+
Requires-Dist: pytest>=7.0.0; extra == "test-sqlserver"
|
66
|
+
Requires-Dist: pyodbc>=4.0.0; extra == "test-sqlserver"
|
75
67
|
Dynamic: license-file
|
76
68
|
|
77
69
|
# Thoth Database Manager
|
@@ -88,8 +80,79 @@ A Python library for managing SQL databases with support for multiple database t
|
|
88
80
|
|
89
81
|
## Installation
|
90
82
|
|
83
|
+
### Basic Installation
|
84
|
+
|
85
|
+
```bash
|
86
|
+
uv add thoth-dbmanager
|
87
|
+
```
|
88
|
+
|
89
|
+
### Installation with Database Support
|
90
|
+
|
91
|
+
To use specific databases, you'll need to install the corresponding database drivers. You can install them individually or use our convenience extras:
|
92
|
+
|
93
|
+
#### Install with All Database Support
|
94
|
+
|
95
|
+
```bash
|
96
|
+
uv add thoth-dbmanager[all]
|
97
|
+
```
|
98
|
+
|
99
|
+
#### Install with Specific Database Support
|
100
|
+
|
101
|
+
**PostgreSQL:**
|
102
|
+
|
103
|
+
```bash
|
104
|
+
uv add thoth-dbmanager[postgresql]
|
105
|
+
# or manually: uv add psycopg2-binary
|
106
|
+
```
|
107
|
+
|
108
|
+
**MySQL:**
|
109
|
+
|
110
|
+
```bash
|
111
|
+
uv add thoth-dbmanager[mysql]
|
112
|
+
# or manually: uv add mysql-connector-python
|
113
|
+
```
|
114
|
+
|
115
|
+
**MariaDB:**
|
116
|
+
|
117
|
+
```bash
|
118
|
+
uv add thoth-dbmanager[mariadb]
|
119
|
+
# or manually: uv add mariadb
|
120
|
+
```
|
121
|
+
|
122
|
+
**SQL Server:**
|
123
|
+
|
124
|
+
```bash
|
125
|
+
uv add thoth-dbmanager[sqlserver]
|
126
|
+
# or manually: uv add pyodbc
|
127
|
+
```
|
128
|
+
|
129
|
+
**Oracle:**
|
130
|
+
|
131
|
+
```bash
|
132
|
+
uv add thoth-dbmanager[oracle]
|
133
|
+
# or manually: uv add cx_Oracle
|
134
|
+
```
|
135
|
+
|
136
|
+
**Informix:**
|
137
|
+
|
138
|
+
```bash
|
139
|
+
uv add thoth-dbmanager[informix]
|
140
|
+
# or manually: uv add IfxPy
|
141
|
+
```
|
142
|
+
|
143
|
+
**Supabase:**
|
144
|
+
|
91
145
|
```bash
|
92
|
-
|
146
|
+
uv add thoth-dbmanager[supabase]
|
147
|
+
# or manually: uv add supabase gotrue
|
148
|
+
```
|
149
|
+
|
150
|
+
**SQLite** is supported out of the box (no additional drivers needed).
|
151
|
+
|
152
|
+
#### Development Installation
|
153
|
+
|
154
|
+
```bash
|
155
|
+
uv add thoth-dbmanager[dev]
|
93
156
|
```
|
94
157
|
|
95
158
|
## Quick Start
|
@@ -278,9 +341,17 @@ if hasattr(manager, 'get_columns_as_documents'):
|
|
278
341
|
print(f"Primary Key: {doc.is_pk}")
|
279
342
|
```
|
280
343
|
|
281
|
-
##
|
344
|
+
## Database Connection Examples
|
282
345
|
|
283
346
|
### PostgreSQL
|
347
|
+
|
348
|
+
**Installation:**
|
349
|
+
|
350
|
+
```bash
|
351
|
+
uv add thoth-dbmanager[postgresql]
|
352
|
+
```
|
353
|
+
|
354
|
+
**Usage:**
|
284
355
|
```python
|
285
356
|
manager = ThothDbManager.get_instance(
|
286
357
|
db_type="postgresql",
|
@@ -294,7 +365,63 @@ manager = ThothDbManager.get_instance(
|
|
294
365
|
)
|
295
366
|
```
|
296
367
|
|
368
|
+
### MySQL
|
369
|
+
|
370
|
+
**Installation:**
|
371
|
+
|
372
|
+
```bash
|
373
|
+
uv add thoth-dbmanager[mysql]
|
374
|
+
```
|
375
|
+
|
376
|
+
**Usage:**
|
377
|
+
|
378
|
+
```python
|
379
|
+
manager = ThothDbManager.get_instance(
|
380
|
+
db_type="mysql",
|
381
|
+
db_root_path="./data",
|
382
|
+
db_mode="production",
|
383
|
+
host="localhost",
|
384
|
+
port=3306,
|
385
|
+
database="myapp",
|
386
|
+
user="dbuser",
|
387
|
+
password="dbpass"
|
388
|
+
)
|
389
|
+
```
|
390
|
+
|
391
|
+
### MariaDB
|
392
|
+
|
393
|
+
**Installation:**
|
394
|
+
|
395
|
+
```bash
|
396
|
+
uv add thoth-dbmanager[mariadb]
|
397
|
+
```
|
398
|
+
|
399
|
+
**Usage:**
|
400
|
+
|
401
|
+
```python
|
402
|
+
manager = ThothDbManager.get_instance(
|
403
|
+
db_type="mariadb",
|
404
|
+
db_root_path="./data",
|
405
|
+
db_mode="production",
|
406
|
+
host="localhost",
|
407
|
+
port=3306,
|
408
|
+
database="myapp",
|
409
|
+
user="dbuser",
|
410
|
+
password="dbpass"
|
411
|
+
)
|
412
|
+
```
|
413
|
+
|
297
414
|
### SQLite
|
415
|
+
|
416
|
+
**Installation:**
|
417
|
+
|
418
|
+
```bash
|
419
|
+
# No additional drivers needed - SQLite is included with Python
|
420
|
+
uv add thoth-dbmanager
|
421
|
+
```
|
422
|
+
|
423
|
+
**Usage:**
|
424
|
+
|
298
425
|
```python
|
299
426
|
manager = ThothDbManager.get_instance(
|
300
427
|
db_type="sqlite",
|
@@ -304,20 +431,99 @@ manager = ThothDbManager.get_instance(
|
|
304
431
|
)
|
305
432
|
```
|
306
433
|
|
307
|
-
###
|
434
|
+
### SQL Server
|
435
|
+
|
436
|
+
**Installation:**
|
437
|
+
|
438
|
+
```bash
|
439
|
+
uv add thoth-dbmanager[sqlserver]
|
440
|
+
```
|
441
|
+
|
442
|
+
**Usage:**
|
443
|
+
|
444
|
+
```python
|
445
|
+
manager = ThothDbManager.get_instance(
|
446
|
+
db_type="sqlserver",
|
447
|
+
db_root_path="./data",
|
448
|
+
db_mode="production",
|
449
|
+
server="localhost",
|
450
|
+
database="myapp",
|
451
|
+
user="dbuser",
|
452
|
+
password="dbpass"
|
453
|
+
)
|
454
|
+
```
|
455
|
+
|
456
|
+
### Oracle
|
457
|
+
|
458
|
+
**Installation:**
|
459
|
+
|
460
|
+
```bash
|
461
|
+
uv add thoth-dbmanager[oracle]
|
462
|
+
```
|
463
|
+
|
464
|
+
**Usage:**
|
465
|
+
|
308
466
|
```python
|
309
467
|
manager = ThothDbManager.get_instance(
|
310
|
-
db_type="
|
468
|
+
db_type="oracle",
|
311
469
|
db_root_path="./data",
|
312
470
|
db_mode="production",
|
313
471
|
host="localhost",
|
314
|
-
port=
|
472
|
+
port=1521,
|
473
|
+
service_name="ORCL",
|
474
|
+
user="dbuser",
|
475
|
+
password="dbpass"
|
476
|
+
)
|
477
|
+
```
|
478
|
+
|
479
|
+
### Informix
|
480
|
+
|
481
|
+
**Installation:**
|
482
|
+
|
483
|
+
```bash
|
484
|
+
uv add thoth-dbmanager[informix]
|
485
|
+
```
|
486
|
+
|
487
|
+
**Usage:**
|
488
|
+
|
489
|
+
```python
|
490
|
+
manager = ThothDbManager.get_instance(
|
491
|
+
db_type="informix",
|
492
|
+
db_root_path="./data",
|
493
|
+
db_mode="production",
|
494
|
+
server="informix_server",
|
315
495
|
database="myapp",
|
496
|
+
host="localhost",
|
316
497
|
user="dbuser",
|
317
498
|
password="dbpass"
|
318
499
|
)
|
319
500
|
```
|
320
501
|
|
502
|
+
### Supabase
|
503
|
+
|
504
|
+
**Installation:**
|
505
|
+
|
506
|
+
```bash
|
507
|
+
uv add thoth-dbmanager[supabase]
|
508
|
+
```
|
509
|
+
|
510
|
+
**Usage:**
|
511
|
+
|
512
|
+
```python
|
513
|
+
manager = ThothDbManager.get_instance(
|
514
|
+
db_type="supabase",
|
515
|
+
db_root_path="./data",
|
516
|
+
db_mode="production",
|
517
|
+
host="db.example.supabase.co",
|
518
|
+
port=5432,
|
519
|
+
database="postgres",
|
520
|
+
user="postgres",
|
521
|
+
password="your_password",
|
522
|
+
project_url="https://your-project.supabase.co",
|
523
|
+
api_key="your_supabase_api_key"
|
524
|
+
)
|
525
|
+
```
|
526
|
+
|
321
527
|
## Error Handling
|
322
528
|
|
323
529
|
The library provides clear error messages for common issues:
|
@@ -12,8 +12,79 @@ A Python library for managing SQL databases with support for multiple database t
|
|
12
12
|
|
13
13
|
## Installation
|
14
14
|
|
15
|
+
### Basic Installation
|
16
|
+
|
17
|
+
```bash
|
18
|
+
uv add thoth-dbmanager
|
19
|
+
```
|
20
|
+
|
21
|
+
### Installation with Database Support
|
22
|
+
|
23
|
+
To use specific databases, you'll need to install the corresponding database drivers. You can install them individually or use our convenience extras:
|
24
|
+
|
25
|
+
#### Install with All Database Support
|
26
|
+
|
27
|
+
```bash
|
28
|
+
uv add thoth-dbmanager[all]
|
29
|
+
```
|
30
|
+
|
31
|
+
#### Install with Specific Database Support
|
32
|
+
|
33
|
+
**PostgreSQL:**
|
34
|
+
|
35
|
+
```bash
|
36
|
+
uv add thoth-dbmanager[postgresql]
|
37
|
+
# or manually: uv add psycopg2-binary
|
38
|
+
```
|
39
|
+
|
40
|
+
**MySQL:**
|
41
|
+
|
42
|
+
```bash
|
43
|
+
uv add thoth-dbmanager[mysql]
|
44
|
+
# or manually: uv add mysql-connector-python
|
45
|
+
```
|
46
|
+
|
47
|
+
**MariaDB:**
|
48
|
+
|
49
|
+
```bash
|
50
|
+
uv add thoth-dbmanager[mariadb]
|
51
|
+
# or manually: uv add mariadb
|
52
|
+
```
|
53
|
+
|
54
|
+
**SQL Server:**
|
55
|
+
|
56
|
+
```bash
|
57
|
+
uv add thoth-dbmanager[sqlserver]
|
58
|
+
# or manually: uv add pyodbc
|
59
|
+
```
|
60
|
+
|
61
|
+
**Oracle:**
|
62
|
+
|
63
|
+
```bash
|
64
|
+
uv add thoth-dbmanager[oracle]
|
65
|
+
# or manually: uv add cx_Oracle
|
66
|
+
```
|
67
|
+
|
68
|
+
**Informix:**
|
69
|
+
|
70
|
+
```bash
|
71
|
+
uv add thoth-dbmanager[informix]
|
72
|
+
# or manually: uv add IfxPy
|
73
|
+
```
|
74
|
+
|
75
|
+
**Supabase:**
|
76
|
+
|
15
77
|
```bash
|
16
|
-
|
78
|
+
uv add thoth-dbmanager[supabase]
|
79
|
+
# or manually: uv add supabase gotrue
|
80
|
+
```
|
81
|
+
|
82
|
+
**SQLite** is supported out of the box (no additional drivers needed).
|
83
|
+
|
84
|
+
#### Development Installation
|
85
|
+
|
86
|
+
```bash
|
87
|
+
uv add thoth-dbmanager[dev]
|
17
88
|
```
|
18
89
|
|
19
90
|
## Quick Start
|
@@ -202,9 +273,17 @@ if hasattr(manager, 'get_columns_as_documents'):
|
|
202
273
|
print(f"Primary Key: {doc.is_pk}")
|
203
274
|
```
|
204
275
|
|
205
|
-
##
|
276
|
+
## Database Connection Examples
|
206
277
|
|
207
278
|
### PostgreSQL
|
279
|
+
|
280
|
+
**Installation:**
|
281
|
+
|
282
|
+
```bash
|
283
|
+
uv add thoth-dbmanager[postgresql]
|
284
|
+
```
|
285
|
+
|
286
|
+
**Usage:**
|
208
287
|
```python
|
209
288
|
manager = ThothDbManager.get_instance(
|
210
289
|
db_type="postgresql",
|
@@ -218,7 +297,63 @@ manager = ThothDbManager.get_instance(
|
|
218
297
|
)
|
219
298
|
```
|
220
299
|
|
300
|
+
### MySQL
|
301
|
+
|
302
|
+
**Installation:**
|
303
|
+
|
304
|
+
```bash
|
305
|
+
uv add thoth-dbmanager[mysql]
|
306
|
+
```
|
307
|
+
|
308
|
+
**Usage:**
|
309
|
+
|
310
|
+
```python
|
311
|
+
manager = ThothDbManager.get_instance(
|
312
|
+
db_type="mysql",
|
313
|
+
db_root_path="./data",
|
314
|
+
db_mode="production",
|
315
|
+
host="localhost",
|
316
|
+
port=3306,
|
317
|
+
database="myapp",
|
318
|
+
user="dbuser",
|
319
|
+
password="dbpass"
|
320
|
+
)
|
321
|
+
```
|
322
|
+
|
323
|
+
### MariaDB
|
324
|
+
|
325
|
+
**Installation:**
|
326
|
+
|
327
|
+
```bash
|
328
|
+
uv add thoth-dbmanager[mariadb]
|
329
|
+
```
|
330
|
+
|
331
|
+
**Usage:**
|
332
|
+
|
333
|
+
```python
|
334
|
+
manager = ThothDbManager.get_instance(
|
335
|
+
db_type="mariadb",
|
336
|
+
db_root_path="./data",
|
337
|
+
db_mode="production",
|
338
|
+
host="localhost",
|
339
|
+
port=3306,
|
340
|
+
database="myapp",
|
341
|
+
user="dbuser",
|
342
|
+
password="dbpass"
|
343
|
+
)
|
344
|
+
```
|
345
|
+
|
221
346
|
### SQLite
|
347
|
+
|
348
|
+
**Installation:**
|
349
|
+
|
350
|
+
```bash
|
351
|
+
# No additional drivers needed - SQLite is included with Python
|
352
|
+
uv add thoth-dbmanager
|
353
|
+
```
|
354
|
+
|
355
|
+
**Usage:**
|
356
|
+
|
222
357
|
```python
|
223
358
|
manager = ThothDbManager.get_instance(
|
224
359
|
db_type="sqlite",
|
@@ -228,20 +363,99 @@ manager = ThothDbManager.get_instance(
|
|
228
363
|
)
|
229
364
|
```
|
230
365
|
|
231
|
-
###
|
366
|
+
### SQL Server
|
367
|
+
|
368
|
+
**Installation:**
|
369
|
+
|
370
|
+
```bash
|
371
|
+
uv add thoth-dbmanager[sqlserver]
|
372
|
+
```
|
373
|
+
|
374
|
+
**Usage:**
|
375
|
+
|
376
|
+
```python
|
377
|
+
manager = ThothDbManager.get_instance(
|
378
|
+
db_type="sqlserver",
|
379
|
+
db_root_path="./data",
|
380
|
+
db_mode="production",
|
381
|
+
server="localhost",
|
382
|
+
database="myapp",
|
383
|
+
user="dbuser",
|
384
|
+
password="dbpass"
|
385
|
+
)
|
386
|
+
```
|
387
|
+
|
388
|
+
### Oracle
|
389
|
+
|
390
|
+
**Installation:**
|
391
|
+
|
392
|
+
```bash
|
393
|
+
uv add thoth-dbmanager[oracle]
|
394
|
+
```
|
395
|
+
|
396
|
+
**Usage:**
|
397
|
+
|
232
398
|
```python
|
233
399
|
manager = ThothDbManager.get_instance(
|
234
|
-
db_type="
|
400
|
+
db_type="oracle",
|
235
401
|
db_root_path="./data",
|
236
402
|
db_mode="production",
|
237
403
|
host="localhost",
|
238
|
-
port=
|
404
|
+
port=1521,
|
405
|
+
service_name="ORCL",
|
406
|
+
user="dbuser",
|
407
|
+
password="dbpass"
|
408
|
+
)
|
409
|
+
```
|
410
|
+
|
411
|
+
### Informix
|
412
|
+
|
413
|
+
**Installation:**
|
414
|
+
|
415
|
+
```bash
|
416
|
+
uv add thoth-dbmanager[informix]
|
417
|
+
```
|
418
|
+
|
419
|
+
**Usage:**
|
420
|
+
|
421
|
+
```python
|
422
|
+
manager = ThothDbManager.get_instance(
|
423
|
+
db_type="informix",
|
424
|
+
db_root_path="./data",
|
425
|
+
db_mode="production",
|
426
|
+
server="informix_server",
|
239
427
|
database="myapp",
|
428
|
+
host="localhost",
|
240
429
|
user="dbuser",
|
241
430
|
password="dbpass"
|
242
431
|
)
|
243
432
|
```
|
244
433
|
|
434
|
+
### Supabase
|
435
|
+
|
436
|
+
**Installation:**
|
437
|
+
|
438
|
+
```bash
|
439
|
+
uv add thoth-dbmanager[supabase]
|
440
|
+
```
|
441
|
+
|
442
|
+
**Usage:**
|
443
|
+
|
444
|
+
```python
|
445
|
+
manager = ThothDbManager.get_instance(
|
446
|
+
db_type="supabase",
|
447
|
+
db_root_path="./data",
|
448
|
+
db_mode="production",
|
449
|
+
host="db.example.supabase.co",
|
450
|
+
port=5432,
|
451
|
+
database="postgres",
|
452
|
+
user="postgres",
|
453
|
+
password="your_password",
|
454
|
+
project_url="https://your-project.supabase.co",
|
455
|
+
api_key="your_supabase_api_key"
|
456
|
+
)
|
457
|
+
```
|
458
|
+
|
245
459
|
## Error Handling
|
246
460
|
|
247
461
|
The library provides clear error messages for common issues:
|
@@ -1,20 +1,20 @@
|
|
1
1
|
[build-system]
|
2
|
-
requires = ["setuptools>=61.0"]
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
3
3
|
build-backend = "setuptools.build_meta"
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "thoth_dbmanager"
|
7
|
-
version = "0.5.
|
7
|
+
version = "0.5.2"
|
8
8
|
authors = [
|
9
9
|
{ name="Marco Pancotti", email="mp@tylconsulting.it" },
|
10
10
|
]
|
11
11
|
description = "A Python library for managing SQL databases with support for multiple database types, LSH-based similarity search, and a modern plugin architecture."
|
12
12
|
readme = "README.md"
|
13
13
|
keywords = ["database", "sql", "lsh", "similarity-search", "orm"]
|
14
|
-
requires-python = ">=3.
|
14
|
+
requires-python = ">=3.9"
|
15
15
|
classifiers = [
|
16
16
|
"Programming Language :: Python :: 3",
|
17
|
-
|
17
|
+
|
18
18
|
"Programming Language :: Python :: 3.9",
|
19
19
|
"Programming Language :: Python :: 3.10",
|
20
20
|
"Programming Language :: Python :: 3.11",
|
@@ -36,23 +36,18 @@ dependencies = [
|
|
36
36
|
]
|
37
37
|
[project.optional-dependencies]
|
38
38
|
postgresql = ["psycopg2-binary>=2.9.0"]
|
39
|
-
mysql = ["mysql-connector-python>=8.0.0"]
|
40
39
|
mariadb = ["mariadb>=1.1.0"]
|
41
|
-
sqlserver = ["pyodbc>=4.0.0"
|
42
|
-
oracle = ["cx_Oracle>=8.3.0", "oracledb>=3.0.0"]
|
43
|
-
supabase = ["supabase>=2.0.0", "postgrest-py>=0.10.0", "gotrue>=1.0.0"]
|
40
|
+
sqlserver = ["pyodbc>=4.0.0"]
|
44
41
|
sqlite = []
|
42
|
+
embeddings = ["sentence-transformers>=2.0.0", "numpy>=1.21.0"]
|
45
43
|
|
46
44
|
# Convenience groups
|
47
45
|
all = [
|
48
46
|
"psycopg2-binary>=2.9.0",
|
49
|
-
"mysql-connector-python>=8.0.0",
|
50
47
|
"mariadb>=1.1.0",
|
51
48
|
"pyodbc>=4.0.0",
|
52
|
-
"
|
53
|
-
"
|
54
|
-
"oracledb>=3.0.0",
|
55
|
-
"supabase>=2.0.0",
|
49
|
+
"sentence-transformers>=2.0.0",
|
50
|
+
"numpy>=1.21.0",
|
56
51
|
]
|
57
52
|
|
58
53
|
# Development dependencies
|
@@ -71,7 +66,8 @@ dev = [
|
|
71
66
|
|
72
67
|
# Testing with specific databases
|
73
68
|
test-postgresql = ["pytest>=7.0.0", "psycopg2-binary>=2.9.0"]
|
74
|
-
test-
|
69
|
+
test-mariadb = ["pytest>=7.0.0", "mariadb>=1.1.0"]
|
70
|
+
test-sqlserver = ["pytest>=7.0.0", "pyodbc>=4.0.0"]
|
75
71
|
|
76
72
|
[project.urls]
|
77
73
|
"Homepage" = "https://github.com/mptyl/thoth_dbmanager"
|