QueryShield probe for FastAPI and SQLAlchemy ORM
Project description
queryshield-sqlalchemy
SQLAlchemy database query performance probe for QueryShield.
Detect and analyze N+1 queries, missing indexes, slow queries, and other performance issues in SQLAlchemy applications.
Features
- N+1 query detection
- EXPLAIN plan analysis
- Missing index detection
- Query budget enforcement
- Integration with pytest
- Integration with FastAPI
- Multi-database support (PostgreSQL, MySQL, SQLite)
Installation
pip install queryshield-sqlalchemy
Usage
Pytest Integration
from queryshield_sqlalchemy import QueryShieldProbe
def test_user_queries(session):
probe = QueryShieldProbe(session)
users = session.query(User).all()
for user in users:
print(user.email)
report = probe.finalize()
FastAPI Integration
from queryshield_sqlalchemy import FastAPIProbe
app = FastAPI()
probe = FastAPIProbe()
@app.get("/users")
def get_users(session: Session):
users = session.query(User).all()
return users
Documentation
See the main QueryShield documentation for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file queryshield_sqlalchemy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: queryshield_sqlalchemy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17b402d1e4ef339f65e3fc5a6c6b02b21e0a6c82bc6ca644d05cfc78de939133
|
|
| MD5 |
98c2f8d5fe907609b9c04de8224b46d6
|
|
| BLAKE2b-256 |
2b02e3d7b15e16aeb1ab72584a2c169084c2b3140896679eae0bc6f9423912df
|