Capture-db-queries

Latest version: v1.2.8

Safety actively analyzes 722460 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

1.2.8

"sqlparse>=0.4.4"
"pygments>=2.17.2"

1.2.7

1.2.6

pytest.mark.asyncio()
pytest.mark.django_db(transaction=True)
async def test_1(self):
async with CaptureQueries(number_runs=1, advanced_verb=True) as ctx:
response = await self.client.get(url)

>>> Queries count: 10 | Execution time: 0.04s | Vendor: sqlite

1.2.5

Customization of the display
> To customize the display of SQL queries, you can import a list with handlers and remove handlers from it or expand it with your own handlers.

python
from capture_db_queries import settings, IHandler

NOTE: The handler must comply with the specified interface.
class SomeHandler(IHandler):
def handle(self, queries_log):
for query in queries_log:
query.sql = "Hello World!"
return queries_log

settings.PRINTER_HANDLERS.remove("capture_db_queries.handlers.ColorizeSqlHandler")
settings.PRINTER_HANDLERS.append("path.to.your.handler.SomeHandler")

1.2.4

1.2.3

Added a logging system
Fixed exception with 0 requests in the body being checked
Added sql coloring
Redesigned logic and added tests

Page 1 of 3

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.