SQLPyHelper 0.1.7__tar.gz → 0.1.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.
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/PKG-INFO +69 -18
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/README.md +51 -17
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/SQLPyHelper.egg-info/PKG-INFO +69 -18
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/SQLPyHelper.egg-info/SOURCES.txt +2 -0
- sqlpyhelper-0.1.9/SQLPyHelper.egg-info/requires.txt +42 -0
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/pyproject.toml +3 -0
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/setup.py +8 -5
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/sqlpyhelper/__init__.py +6 -1
- sqlpyhelper-0.1.9/sqlpyhelper/async_helper.py +598 -0
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/sqlpyhelper/db_helper.py +1 -0
- sqlpyhelper-0.1.9/test/test_async_helper.py +478 -0
- sqlpyhelper-0.1.7/SQLPyHelper.egg-info/requires.txt +0 -20
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/LICENSE +0 -0
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/SQLPyHelper.egg-info/dependency_links.txt +0 -0
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/SQLPyHelper.egg-info/entry_points.txt +0 -0
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/SQLPyHelper.egg-info/top_level.txt +0 -0
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/setup.cfg +0 -0
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/sqlpyhelper/automation_utils.py +0 -0
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/sqlpyhelper/cli.py +0 -0
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/sqlpyhelper/migration.py +0 -0
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/sqlpyhelper/py.typed +0 -0
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/test/test_migration.py +0 -0
- {sqlpyhelper-0.1.7 → sqlpyhelper-0.1.9}/test/test_sqlpyhelper.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: SQLPyHelper
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: A simple SQL database helper package for Python.
|
|
5
5
|
Home-page: https://github.com/adebayopeter/sqlpyhelper
|
|
6
6
|
Author: Adebayo Olaonipekun
|
|
@@ -34,11 +34,28 @@ Provides-Extra: sqlserver
|
|
|
34
34
|
Requires-Dist: pyodbc; extra == "sqlserver"
|
|
35
35
|
Provides-Extra: oracle
|
|
36
36
|
Requires-Dist: oracledb; extra == "oracle"
|
|
37
|
+
Provides-Extra: async-postgres
|
|
38
|
+
Requires-Dist: asyncpg; extra == "async-postgres"
|
|
39
|
+
Provides-Extra: async-mysql
|
|
40
|
+
Requires-Dist: aiomysql; extra == "async-mysql"
|
|
41
|
+
Provides-Extra: async-sqlite
|
|
42
|
+
Requires-Dist: aiosqlite; extra == "async-sqlite"
|
|
43
|
+
Provides-Extra: async-sqlserver
|
|
44
|
+
Requires-Dist: aioodbc; extra == "async-sqlserver"
|
|
45
|
+
Provides-Extra: async-all
|
|
46
|
+
Requires-Dist: asyncpg; extra == "async-all"
|
|
47
|
+
Requires-Dist: aiomysql; extra == "async-all"
|
|
48
|
+
Requires-Dist: aiosqlite; extra == "async-all"
|
|
49
|
+
Requires-Dist: aioodbc; extra == "async-all"
|
|
37
50
|
Provides-Extra: all
|
|
38
51
|
Requires-Dist: psycopg2; extra == "all"
|
|
39
52
|
Requires-Dist: mysql-connector-python; extra == "all"
|
|
40
53
|
Requires-Dist: pyodbc; extra == "all"
|
|
41
54
|
Requires-Dist: oracledb; extra == "all"
|
|
55
|
+
Requires-Dist: asyncpg; extra == "all"
|
|
56
|
+
Requires-Dist: aiomysql; extra == "all"
|
|
57
|
+
Requires-Dist: aiosqlite; extra == "all"
|
|
58
|
+
Requires-Dist: aioodbc; extra == "all"
|
|
42
59
|
Dynamic: author
|
|
43
60
|
Dynamic: author-email
|
|
44
61
|
Dynamic: classifier
|
|
@@ -84,6 +101,7 @@ with SQLPyHelper(db_type="postgres", host="localhost", user="user",
|
|
|
84
101
|
- [MySQL Example](#mysql-example)
|
|
85
102
|
- [SQL Server Example](#sql-server-example)
|
|
86
103
|
- [Oracle Example](#oracle-example)
|
|
104
|
+
- [Async Example (FastAPI / asyncio)](#async-example-fastapi--asyncio)
|
|
87
105
|
- [📂 Project Structure](#-project-structure)
|
|
88
106
|
- [📌 Available Methods in SQLPyHelper](#-available-methods-in-sqlpyhelper)
|
|
89
107
|
- [🌍 Contributing](#-contributing)
|
|
@@ -91,14 +109,16 @@ with SQLPyHelper(db_type="postgres", host="localhost", user="user",
|
|
|
91
109
|
|
|
92
110
|
---
|
|
93
111
|
|
|
94
|
-
## 🚀 Features in v0.1.
|
|
95
|
-
- Unified connection pooling for multiple databases.
|
|
96
|
-
- Automatic reconnection for lost connections.
|
|
97
|
-
- Transaction support (BEGIN, ROLLBACK, COMMIT).
|
|
98
|
-
- Secure parameterized queries to prevent SQL injection.
|
|
99
|
-
- Bulk insertion & dynamic table creation.
|
|
100
|
-
- Logging & error handling for better debugging.
|
|
112
|
+
## 🚀 Features in v0.1.8
|
|
113
|
+
- Unified connection pooling for multiple databases.
|
|
114
|
+
- Automatic reconnection for lost connections.
|
|
115
|
+
- Transaction support (BEGIN, ROLLBACK, COMMIT).
|
|
116
|
+
- Secure parameterized queries to prevent SQL injection.
|
|
117
|
+
- Bulk insertion & dynamic table creation.
|
|
118
|
+
- Logging & error handling for better debugging.
|
|
101
119
|
- CSV export & database backups.
|
|
120
|
+
- **Cross-database migration** — copy tables between any two supported databases.
|
|
121
|
+
- **Async support** — `AsyncSQLPyHelper` for FastAPI and asyncio applications.
|
|
102
122
|
|
|
103
123
|
---
|
|
104
124
|
## 📦 Installation
|
|
@@ -197,20 +217,50 @@ db.setup_connection_pool(min_conn=2, max_conn=10) # Enable pooling for better p
|
|
|
197
217
|
conn = db.get_connection_from_pool()
|
|
198
218
|
db.return_connection_to_pool(conn)
|
|
199
219
|
```
|
|
220
|
+
### Async Example (FastAPI / asyncio)
|
|
221
|
+
```python
|
|
222
|
+
import asyncio
|
|
223
|
+
from sqlpyhelper.async_helper import AsyncSQLPyHelper
|
|
224
|
+
|
|
225
|
+
async def main():
|
|
226
|
+
async with AsyncSQLPyHelper(db_type="sqlite", database="my.db") as db:
|
|
227
|
+
await db.execute(
|
|
228
|
+
"CREATE TABLE IF NOT EXISTS users (id INTEGER, name TEXT)"
|
|
229
|
+
)
|
|
230
|
+
await db.execute(
|
|
231
|
+
"INSERT INTO users VALUES ($1, $2)", 1, "Alice"
|
|
232
|
+
)
|
|
233
|
+
rows = await db.fetch_all("SELECT * FROM users")
|
|
234
|
+
print(rows)
|
|
235
|
+
|
|
236
|
+
asyncio.run(main())
|
|
237
|
+
```
|
|
200
238
|
|
|
201
239
|
## 📂 Project Structure
|
|
202
240
|
```
|
|
203
241
|
📦 SQLPyHelper/
|
|
204
|
-
├─
|
|
205
|
-
│
|
|
206
|
-
│
|
|
207
|
-
├─
|
|
208
|
-
│
|
|
209
|
-
├─
|
|
210
|
-
|
|
211
|
-
├─
|
|
212
|
-
├─
|
|
213
|
-
|
|
242
|
+
├─ sqlpyhelper/
|
|
243
|
+
│ ├─ __init__.py
|
|
244
|
+
│ ├─ db_helper.py
|
|
245
|
+
│ ├─ async_helper.py
|
|
246
|
+
│ ├─ automation_utils.py
|
|
247
|
+
│ ├─ cli.py
|
|
248
|
+
│ └─ migration.py
|
|
249
|
+
├─ test/
|
|
250
|
+
│ ├─ test_sqlpyhelper.py
|
|
251
|
+
│ ├─ test_async_helper.py
|
|
252
|
+
│ └─ test_migration.py
|
|
253
|
+
├─ docs/
|
|
254
|
+
├─ .env_example
|
|
255
|
+
├─ .gitignore
|
|
256
|
+
├─ setup.py
|
|
257
|
+
├─ setup.cfg
|
|
258
|
+
├─ pyproject.toml
|
|
259
|
+
├─ CHANGELOG.md
|
|
260
|
+
├─ CONTRIBUTING.md
|
|
261
|
+
├─ pre-commit.sh
|
|
262
|
+
├─ README.md
|
|
263
|
+
└─ requirements.txt
|
|
214
264
|
```
|
|
215
265
|
---
|
|
216
266
|
## 📌 Available Methods in SQLPyHelper
|
|
@@ -232,6 +282,7 @@ db.return_connection_to_pool(conn)
|
|
|
232
282
|
| `commit_transaction()` | Commits the current transaction. |
|
|
233
283
|
| `close()` | Closes the database connection safely. |
|
|
234
284
|
| `__enter__` / `__exit__()` | Use as a context manager — connection closes automatically. |
|
|
285
|
+
| `AsyncSQLPyHelper` | Async-native class for FastAPI/asyncio — see [Async docs](https://sqlpyhelper.readthedocs.io/en/latest/async.html). |
|
|
235
286
|
|
|
236
287
|
---
|
|
237
288
|
## 🌍 Contributing
|
|
@@ -29,6 +29,7 @@ with SQLPyHelper(db_type="postgres", host="localhost", user="user",
|
|
|
29
29
|
- [MySQL Example](#mysql-example)
|
|
30
30
|
- [SQL Server Example](#sql-server-example)
|
|
31
31
|
- [Oracle Example](#oracle-example)
|
|
32
|
+
- [Async Example (FastAPI / asyncio)](#async-example-fastapi--asyncio)
|
|
32
33
|
- [📂 Project Structure](#-project-structure)
|
|
33
34
|
- [📌 Available Methods in SQLPyHelper](#-available-methods-in-sqlpyhelper)
|
|
34
35
|
- [🌍 Contributing](#-contributing)
|
|
@@ -36,14 +37,16 @@ with SQLPyHelper(db_type="postgres", host="localhost", user="user",
|
|
|
36
37
|
|
|
37
38
|
---
|
|
38
39
|
|
|
39
|
-
## 🚀 Features in v0.1.
|
|
40
|
-
- Unified connection pooling for multiple databases.
|
|
41
|
-
- Automatic reconnection for lost connections.
|
|
42
|
-
- Transaction support (BEGIN, ROLLBACK, COMMIT).
|
|
43
|
-
- Secure parameterized queries to prevent SQL injection.
|
|
44
|
-
- Bulk insertion & dynamic table creation.
|
|
45
|
-
- Logging & error handling for better debugging.
|
|
40
|
+
## 🚀 Features in v0.1.8
|
|
41
|
+
- Unified connection pooling for multiple databases.
|
|
42
|
+
- Automatic reconnection for lost connections.
|
|
43
|
+
- Transaction support (BEGIN, ROLLBACK, COMMIT).
|
|
44
|
+
- Secure parameterized queries to prevent SQL injection.
|
|
45
|
+
- Bulk insertion & dynamic table creation.
|
|
46
|
+
- Logging & error handling for better debugging.
|
|
46
47
|
- CSV export & database backups.
|
|
48
|
+
- **Cross-database migration** — copy tables between any two supported databases.
|
|
49
|
+
- **Async support** — `AsyncSQLPyHelper` for FastAPI and asyncio applications.
|
|
47
50
|
|
|
48
51
|
---
|
|
49
52
|
## 📦 Installation
|
|
@@ -142,20 +145,50 @@ db.setup_connection_pool(min_conn=2, max_conn=10) # Enable pooling for better p
|
|
|
142
145
|
conn = db.get_connection_from_pool()
|
|
143
146
|
db.return_connection_to_pool(conn)
|
|
144
147
|
```
|
|
148
|
+
### Async Example (FastAPI / asyncio)
|
|
149
|
+
```python
|
|
150
|
+
import asyncio
|
|
151
|
+
from sqlpyhelper.async_helper import AsyncSQLPyHelper
|
|
152
|
+
|
|
153
|
+
async def main():
|
|
154
|
+
async with AsyncSQLPyHelper(db_type="sqlite", database="my.db") as db:
|
|
155
|
+
await db.execute(
|
|
156
|
+
"CREATE TABLE IF NOT EXISTS users (id INTEGER, name TEXT)"
|
|
157
|
+
)
|
|
158
|
+
await db.execute(
|
|
159
|
+
"INSERT INTO users VALUES ($1, $2)", 1, "Alice"
|
|
160
|
+
)
|
|
161
|
+
rows = await db.fetch_all("SELECT * FROM users")
|
|
162
|
+
print(rows)
|
|
163
|
+
|
|
164
|
+
asyncio.run(main())
|
|
165
|
+
```
|
|
145
166
|
|
|
146
167
|
## 📂 Project Structure
|
|
147
168
|
```
|
|
148
169
|
📦 SQLPyHelper/
|
|
149
|
-
├─
|
|
150
|
-
│
|
|
151
|
-
│
|
|
152
|
-
├─
|
|
153
|
-
│
|
|
154
|
-
├─
|
|
155
|
-
|
|
156
|
-
├─
|
|
157
|
-
├─
|
|
158
|
-
|
|
170
|
+
├─ sqlpyhelper/
|
|
171
|
+
│ ├─ __init__.py
|
|
172
|
+
│ ├─ db_helper.py
|
|
173
|
+
│ ├─ async_helper.py
|
|
174
|
+
│ ├─ automation_utils.py
|
|
175
|
+
│ ├─ cli.py
|
|
176
|
+
│ └─ migration.py
|
|
177
|
+
├─ test/
|
|
178
|
+
│ ├─ test_sqlpyhelper.py
|
|
179
|
+
│ ├─ test_async_helper.py
|
|
180
|
+
│ └─ test_migration.py
|
|
181
|
+
├─ docs/
|
|
182
|
+
├─ .env_example
|
|
183
|
+
├─ .gitignore
|
|
184
|
+
├─ setup.py
|
|
185
|
+
├─ setup.cfg
|
|
186
|
+
├─ pyproject.toml
|
|
187
|
+
├─ CHANGELOG.md
|
|
188
|
+
├─ CONTRIBUTING.md
|
|
189
|
+
├─ pre-commit.sh
|
|
190
|
+
├─ README.md
|
|
191
|
+
└─ requirements.txt
|
|
159
192
|
```
|
|
160
193
|
---
|
|
161
194
|
## 📌 Available Methods in SQLPyHelper
|
|
@@ -177,6 +210,7 @@ db.return_connection_to_pool(conn)
|
|
|
177
210
|
| `commit_transaction()` | Commits the current transaction. |
|
|
178
211
|
| `close()` | Closes the database connection safely. |
|
|
179
212
|
| `__enter__` / `__exit__()` | Use as a context manager — connection closes automatically. |
|
|
213
|
+
| `AsyncSQLPyHelper` | Async-native class for FastAPI/asyncio — see [Async docs](https://sqlpyhelper.readthedocs.io/en/latest/async.html). |
|
|
180
214
|
|
|
181
215
|
---
|
|
182
216
|
## 🌍 Contributing
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: SQLPyHelper
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: A simple SQL database helper package for Python.
|
|
5
5
|
Home-page: https://github.com/adebayopeter/sqlpyhelper
|
|
6
6
|
Author: Adebayo Olaonipekun
|
|
@@ -34,11 +34,28 @@ Provides-Extra: sqlserver
|
|
|
34
34
|
Requires-Dist: pyodbc; extra == "sqlserver"
|
|
35
35
|
Provides-Extra: oracle
|
|
36
36
|
Requires-Dist: oracledb; extra == "oracle"
|
|
37
|
+
Provides-Extra: async-postgres
|
|
38
|
+
Requires-Dist: asyncpg; extra == "async-postgres"
|
|
39
|
+
Provides-Extra: async-mysql
|
|
40
|
+
Requires-Dist: aiomysql; extra == "async-mysql"
|
|
41
|
+
Provides-Extra: async-sqlite
|
|
42
|
+
Requires-Dist: aiosqlite; extra == "async-sqlite"
|
|
43
|
+
Provides-Extra: async-sqlserver
|
|
44
|
+
Requires-Dist: aioodbc; extra == "async-sqlserver"
|
|
45
|
+
Provides-Extra: async-all
|
|
46
|
+
Requires-Dist: asyncpg; extra == "async-all"
|
|
47
|
+
Requires-Dist: aiomysql; extra == "async-all"
|
|
48
|
+
Requires-Dist: aiosqlite; extra == "async-all"
|
|
49
|
+
Requires-Dist: aioodbc; extra == "async-all"
|
|
37
50
|
Provides-Extra: all
|
|
38
51
|
Requires-Dist: psycopg2; extra == "all"
|
|
39
52
|
Requires-Dist: mysql-connector-python; extra == "all"
|
|
40
53
|
Requires-Dist: pyodbc; extra == "all"
|
|
41
54
|
Requires-Dist: oracledb; extra == "all"
|
|
55
|
+
Requires-Dist: asyncpg; extra == "all"
|
|
56
|
+
Requires-Dist: aiomysql; extra == "all"
|
|
57
|
+
Requires-Dist: aiosqlite; extra == "all"
|
|
58
|
+
Requires-Dist: aioodbc; extra == "all"
|
|
42
59
|
Dynamic: author
|
|
43
60
|
Dynamic: author-email
|
|
44
61
|
Dynamic: classifier
|
|
@@ -84,6 +101,7 @@ with SQLPyHelper(db_type="postgres", host="localhost", user="user",
|
|
|
84
101
|
- [MySQL Example](#mysql-example)
|
|
85
102
|
- [SQL Server Example](#sql-server-example)
|
|
86
103
|
- [Oracle Example](#oracle-example)
|
|
104
|
+
- [Async Example (FastAPI / asyncio)](#async-example-fastapi--asyncio)
|
|
87
105
|
- [📂 Project Structure](#-project-structure)
|
|
88
106
|
- [📌 Available Methods in SQLPyHelper](#-available-methods-in-sqlpyhelper)
|
|
89
107
|
- [🌍 Contributing](#-contributing)
|
|
@@ -91,14 +109,16 @@ with SQLPyHelper(db_type="postgres", host="localhost", user="user",
|
|
|
91
109
|
|
|
92
110
|
---
|
|
93
111
|
|
|
94
|
-
## 🚀 Features in v0.1.
|
|
95
|
-
- Unified connection pooling for multiple databases.
|
|
96
|
-
- Automatic reconnection for lost connections.
|
|
97
|
-
- Transaction support (BEGIN, ROLLBACK, COMMIT).
|
|
98
|
-
- Secure parameterized queries to prevent SQL injection.
|
|
99
|
-
- Bulk insertion & dynamic table creation.
|
|
100
|
-
- Logging & error handling for better debugging.
|
|
112
|
+
## 🚀 Features in v0.1.8
|
|
113
|
+
- Unified connection pooling for multiple databases.
|
|
114
|
+
- Automatic reconnection for lost connections.
|
|
115
|
+
- Transaction support (BEGIN, ROLLBACK, COMMIT).
|
|
116
|
+
- Secure parameterized queries to prevent SQL injection.
|
|
117
|
+
- Bulk insertion & dynamic table creation.
|
|
118
|
+
- Logging & error handling for better debugging.
|
|
101
119
|
- CSV export & database backups.
|
|
120
|
+
- **Cross-database migration** — copy tables between any two supported databases.
|
|
121
|
+
- **Async support** — `AsyncSQLPyHelper` for FastAPI and asyncio applications.
|
|
102
122
|
|
|
103
123
|
---
|
|
104
124
|
## 📦 Installation
|
|
@@ -197,20 +217,50 @@ db.setup_connection_pool(min_conn=2, max_conn=10) # Enable pooling for better p
|
|
|
197
217
|
conn = db.get_connection_from_pool()
|
|
198
218
|
db.return_connection_to_pool(conn)
|
|
199
219
|
```
|
|
220
|
+
### Async Example (FastAPI / asyncio)
|
|
221
|
+
```python
|
|
222
|
+
import asyncio
|
|
223
|
+
from sqlpyhelper.async_helper import AsyncSQLPyHelper
|
|
224
|
+
|
|
225
|
+
async def main():
|
|
226
|
+
async with AsyncSQLPyHelper(db_type="sqlite", database="my.db") as db:
|
|
227
|
+
await db.execute(
|
|
228
|
+
"CREATE TABLE IF NOT EXISTS users (id INTEGER, name TEXT)"
|
|
229
|
+
)
|
|
230
|
+
await db.execute(
|
|
231
|
+
"INSERT INTO users VALUES ($1, $2)", 1, "Alice"
|
|
232
|
+
)
|
|
233
|
+
rows = await db.fetch_all("SELECT * FROM users")
|
|
234
|
+
print(rows)
|
|
235
|
+
|
|
236
|
+
asyncio.run(main())
|
|
237
|
+
```
|
|
200
238
|
|
|
201
239
|
## 📂 Project Structure
|
|
202
240
|
```
|
|
203
241
|
📦 SQLPyHelper/
|
|
204
|
-
├─
|
|
205
|
-
│
|
|
206
|
-
│
|
|
207
|
-
├─
|
|
208
|
-
│
|
|
209
|
-
├─
|
|
210
|
-
|
|
211
|
-
├─
|
|
212
|
-
├─
|
|
213
|
-
|
|
242
|
+
├─ sqlpyhelper/
|
|
243
|
+
│ ├─ __init__.py
|
|
244
|
+
│ ├─ db_helper.py
|
|
245
|
+
│ ├─ async_helper.py
|
|
246
|
+
│ ├─ automation_utils.py
|
|
247
|
+
│ ├─ cli.py
|
|
248
|
+
│ └─ migration.py
|
|
249
|
+
├─ test/
|
|
250
|
+
│ ├─ test_sqlpyhelper.py
|
|
251
|
+
│ ├─ test_async_helper.py
|
|
252
|
+
│ └─ test_migration.py
|
|
253
|
+
├─ docs/
|
|
254
|
+
├─ .env_example
|
|
255
|
+
├─ .gitignore
|
|
256
|
+
├─ setup.py
|
|
257
|
+
├─ setup.cfg
|
|
258
|
+
├─ pyproject.toml
|
|
259
|
+
├─ CHANGELOG.md
|
|
260
|
+
├─ CONTRIBUTING.md
|
|
261
|
+
├─ pre-commit.sh
|
|
262
|
+
├─ README.md
|
|
263
|
+
└─ requirements.txt
|
|
214
264
|
```
|
|
215
265
|
---
|
|
216
266
|
## 📌 Available Methods in SQLPyHelper
|
|
@@ -232,6 +282,7 @@ db.return_connection_to_pool(conn)
|
|
|
232
282
|
| `commit_transaction()` | Commits the current transaction. |
|
|
233
283
|
| `close()` | Closes the database connection safely. |
|
|
234
284
|
| `__enter__` / `__exit__()` | Use as a context manager — connection closes automatically. |
|
|
285
|
+
| `AsyncSQLPyHelper` | Async-native class for FastAPI/asyncio — see [Async docs](https://sqlpyhelper.readthedocs.io/en/latest/async.html). |
|
|
235
286
|
|
|
236
287
|
---
|
|
237
288
|
## 🌍 Contributing
|
|
@@ -10,10 +10,12 @@ SQLPyHelper.egg-info/entry_points.txt
|
|
|
10
10
|
SQLPyHelper.egg-info/requires.txt
|
|
11
11
|
SQLPyHelper.egg-info/top_level.txt
|
|
12
12
|
sqlpyhelper/__init__.py
|
|
13
|
+
sqlpyhelper/async_helper.py
|
|
13
14
|
sqlpyhelper/automation_utils.py
|
|
14
15
|
sqlpyhelper/cli.py
|
|
15
16
|
sqlpyhelper/db_helper.py
|
|
16
17
|
sqlpyhelper/migration.py
|
|
17
18
|
sqlpyhelper/py.typed
|
|
19
|
+
test/test_async_helper.py
|
|
18
20
|
test/test_migration.py
|
|
19
21
|
test/test_sqlpyhelper.py
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
python-dotenv
|
|
2
|
+
click
|
|
3
|
+
|
|
4
|
+
[all]
|
|
5
|
+
psycopg2
|
|
6
|
+
mysql-connector-python
|
|
7
|
+
pyodbc
|
|
8
|
+
oracledb
|
|
9
|
+
asyncpg
|
|
10
|
+
aiomysql
|
|
11
|
+
aiosqlite
|
|
12
|
+
aioodbc
|
|
13
|
+
|
|
14
|
+
[async-all]
|
|
15
|
+
asyncpg
|
|
16
|
+
aiomysql
|
|
17
|
+
aiosqlite
|
|
18
|
+
aioodbc
|
|
19
|
+
|
|
20
|
+
[async-mysql]
|
|
21
|
+
aiomysql
|
|
22
|
+
|
|
23
|
+
[async-postgres]
|
|
24
|
+
asyncpg
|
|
25
|
+
|
|
26
|
+
[async-sqlite]
|
|
27
|
+
aiosqlite
|
|
28
|
+
|
|
29
|
+
[async-sqlserver]
|
|
30
|
+
aioodbc
|
|
31
|
+
|
|
32
|
+
[mysql]
|
|
33
|
+
mysql-connector-python
|
|
34
|
+
|
|
35
|
+
[oracle]
|
|
36
|
+
oracledb
|
|
37
|
+
|
|
38
|
+
[postgres]
|
|
39
|
+
psycopg2
|
|
40
|
+
|
|
41
|
+
[sqlserver]
|
|
42
|
+
pyodbc
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as f:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name='SQLPyHelper',
|
|
8
|
-
version='0.1.
|
|
8
|
+
version='0.1.9',
|
|
9
9
|
description='A simple SQL database helper package for Python.',
|
|
10
10
|
long_description=long_description,
|
|
11
11
|
long_description_content_type="text/markdown",
|
|
@@ -26,11 +26,14 @@ setup(
|
|
|
26
26
|
"mysql": ["mysql-connector-python"],
|
|
27
27
|
"sqlserver": ["pyodbc"],
|
|
28
28
|
"oracle": ["oracledb"],
|
|
29
|
+
"async-postgres": ["asyncpg"],
|
|
30
|
+
"async-mysql": ["aiomysql"],
|
|
31
|
+
"async-sqlite": ["aiosqlite"],
|
|
32
|
+
"async-sqlserver": ["aioodbc"],
|
|
33
|
+
"async-all": ["asyncpg", "aiomysql", "aiosqlite", "aioodbc"],
|
|
29
34
|
"all": [
|
|
30
|
-
"psycopg2",
|
|
31
|
-
"
|
|
32
|
-
"pyodbc",
|
|
33
|
-
"oracledb",
|
|
35
|
+
"psycopg2", "mysql-connector-python", "pyodbc", "oracledb",
|
|
36
|
+
"asyncpg", "aiomysql", "aiosqlite", "aioodbc",
|
|
34
37
|
],
|
|
35
38
|
},
|
|
36
39
|
keywords=[
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Match the version in setup.py
|
|
2
|
-
__version__ = "0.1.
|
|
2
|
+
__version__ = "0.1.9"
|
|
3
3
|
|
|
4
|
+
from sqlpyhelper.async_helper import ( # noqa: F401
|
|
5
|
+
AsyncConnectionError,
|
|
6
|
+
AsyncQueryError,
|
|
7
|
+
AsyncSQLPyHelper,
|
|
8
|
+
)
|
|
4
9
|
from sqlpyhelper.db_helper import ( # noqa: F401
|
|
5
10
|
BackupError,
|
|
6
11
|
ConnectionError,
|