dbinspector-0.1.1
توضیحات
A libray for use with SQLAlchemy to count queires, log queries, etc...
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | dbinspector-0.1.1 |
| نام | dbinspector |
| نسخه کتابخانه | 0.1.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Chrys Gonsalves |
| ایمیل نویسنده | cgons@pcxchange.ca |
| آدرس صفحه اصلی | https://github.com/cgons/dbinspector |
| آدرس اینترنتی | https://pypi.org/project/dbinspector/ |
| مجوز | - |
# DBInspector
A Python context manager for use with SQLAlchemy.
### Features
- Count the number of queires issued.
- Capture/print the statements/queries issued.
---
### Installation
```
pip install dbinspector
```
### Usage
```
with DBInspector(conn) as inspector:
conn.execute("SELECT 1")
conn.execute("SELECT 1")
# Get query count
assert inspector.get_count() == 2
# Print queries issued
inspector.print_queries(pretty=True)
# Example pretty printed output:
"""
QUERY #1
----------
SELECT 1
QUERY #2
----------
SELECT 1
"""
```
### API
```
DBInspector.get_count() -> int
DBInspector.print_queries(pretty=False)
```
نیازمندی
| مقدار | نام |
|---|---|
| - | psycopg2-binary |
| - | sqlalchemy |
| - | black |
| - | ipdb |
| - | ipython |
| - | pytest |
| - | wheel |
نحوه نصب
نصب پکیج whl dbinspector-0.1.1:
pip install dbinspector-0.1.1.whl
نصب پکیج tar.gz dbinspector-0.1.1:
pip install dbinspector-0.1.1.tar.gz