Changelog#

All notable changes to this project are documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased#

Added#

1.1.0 - 2026-11-20#

1.1.0 is the code of 1.1.0rc1, released five days earlier without reports of problems; see that entry for what is new since 1.0.0 and the two changes to watch when upgrading.

Changed#

Documentation#

1.1.0rc1 - 2026-11-15#

Release candidate for 1.1.0. New: route budgets in pytest, assert_queries_do_not_grow(), baseline labels that match across databases and SQLAlchemy versions, a VS Code extension, llms.txt and a Claude Code plugin for coding agents, and the GitHub Action in its own Marketplace repository. The Django ORM support is no longer experimental; its manage.py test runner and route budgets are new and start experimental. Two changes to watch when upgrading: a loop of the test that calls the application once per pass is now the test code's repetition, not an N+1 (see Changed), and a baseline written by 1.1 does not match on 1.0.x where a label changes form. Install with pip install --pre pytest-queryguard.

Added#

Changed#

Fixed#

Documentation#

Internal#

1.0.0 - 2026-11-14#

The first stable release. The code is that of 1.0.0rc1, which has the changes since 0.10.0; from here on the public API described in stability changes incompatibly only in a major release, new checks start off or as warnings, and fixes go into the latest 1.x minor release. Experimental features stay exempt, as listed there.

Changed#

Documentation#

1.0.0rc1 - 2026-11-09#

Release candidate for 1.0.0. The public surface described in stability is frozen: no renames or removals before 1.0.0 unless a blocker needs one. Install with pip install --pre pytest-queryguard.

Fixed#

Documentation#

Internal#

0.10.0 - 2026-11-08#

Added#

Changed#

Fixed#

Documentation#

Internal#

0.9.0 - 2026-11-07#

Added#

Changed#

Fixed#

Documentation#

Internal#

0.8.0 - 2026-11-06#

This release offers the fix of an N+1 as a patch (--queryguard-show-patch, --queryguard-write-patch for git apply, SARIF fixes), adds an experimental static check (python -m pytest_queryguard.lint), an experimental MCP server for coding agents (python -m pytest_queryguard.mcp), the query-count trend across runs in the GitHub Action, and findings in the HTML page in the in-application mode. Most of the rest is stabilization before 1.0: the relationship rule no longer reports two single-object lookups, strict mode and the report agree, the in-app mode and the plugin share one listener path, and every private SQLAlchemy name is checked by a test of its own.

Upgrading from 0.7.0:

Added#

Changed#

Deprecated#

These keep working and emit a QueryGuardDeprecationWarning naming the replacement (an ini option once per run, a keyword at each call site); they will be removed in 2.0 (#303).

Fixed#

Documentation#

Internal#

0.7.0 - 2026-11-06#

ORM statements cost about a third less to measure: the plugin reads the ORM's options on the SELECT itself and no longer registers a do_orm_execute listener by default. Each finding shows the lines of your code that led to it (called from). New in a test: the queryguard fixture (max_queries / num_queries blocks, like pytest-django's) and pytest_queryguard.ignore() blocks; ignore rules can match the call stack (stack=). The in-app mode can report to OpenTelemetry and Sentry and sample requests. An experimental check reports wide rows of which a test reads few columns.

Upgrading from 0.6.0: reports have up to three more lines per finding (queryguard_stack_depth = 0 restores the old layout). A lazy load answered without a SELECT (your own do_orm_execute cache) is no longer counted, and the cartesian-load check now also sees ORM selects run through Connection.execute(). Nothing else changes for an existing configuration.

Added#

Changed#

Documentation#

0.6.0 - 2026-11-05#

This release adds strict mode (raise at the lazy load), a new finding kind, cartesian-load, a default query budget and a budget file written from a run, per-test JSON output and a pull-request comparison of query counts in the GitHub Action, a link to the documentation in every finding, and a summary that names a finding of many tests once. In-app track() works as a decorator, with async with and with start()/stop().

Upgrading from 0.5.0: cartesian-load warns by default. A suite that turns warnings into errors (filterwarnings = error) and has such a query fails after the upgrade; fix the query, ignore the finding, or set queryguard_cartesian_load = off. Everything else is opt-in.

Added#

Changed#

Fixed#

0.5.0 - 2026-11-01#

The notes of the three release candidates (0.5.0rc1 to 0.5.0rc3) are merged below by section; the entries of the candidates follow unchanged.

This release adds an experimental in-application mode: the same N+1 rules and query budgets on every HTTP request of a running FastAPI, Starlette or Flask application, for development and staging. There is nothing to do when upgrading from 0.4.1: the pytest plugin behaves as before, and no option or default changed. The in-app mode is listed under "Experimental" in the stability policy, so its names may still change in a minor release.

Added#

Changed#

Documentation#

0.5.0rc3 - 2026-11-01#

Third release candidate: install it with pip install --pre pytest-queryguard.

The in-application mode now applies the plugin's column-load rules, and its WSGI middleware no longer cuts a response short under an error warnings filter. Running the mode under uvicorn, granian, gunicorn and waitress found no other defects; what it showed is now documented. The release checks are steadier, and a release is published only after the release gate passed on its commit. The pytest plugin behaves as before; its column-load code is now split into helpers that the in-app mode shares.

Changed#

Fixed#

Documentation#

0.5.0rc2 - 2026-10-31#

Second release candidate: install it with pip install --pre pytest-queryguard.

It fixes the in-application mode after an audit, a code review and a security review of 0.5.0rc1, and adds a token for its panel. The mode stays experimental. The pytest plugin is unchanged apart from documentation.

Added#

Changed#

Fixed#

Documentation#

0.5.0rc1 - 2026-10-24#

Release candidate: install it with pip install --pre pytest-queryguard.

This release adds an experimental in-application mode: the same N+1 rules and query budgets on every HTTP request of a running FastAPI, Starlette or Flask application, for development and staging. The pytest plugin is unchanged.

Added#

0.4.1 - 2026-10-23#

A patch release with two fixes to the database time of record_queries(), max_queries() and max_db_time() when a statement finishes in another thread after the block. Thanks to @Muguett-DBY, who found and fixed the first one.

Fixed#

Documentation#

0.4.0 - 2026-10-14#

The notes of the four release candidates (0.4.0rc1 to 0.4.0rc4) are merged below by section; the entries of the candidates follow unchanged.

This release adds baselines, SARIF output and a GitHub Action, per-finding ignores, new finding kinds (column loads, write loops, unused eager loads), query timing and max_db_time, an index advisor, and a missing-index check for SQLite, MySQL and MariaDB. It also adds a documentation site and runnable examples. Four things can change the result or the output of an existing test run without any new option: the column-load kind is on by default, the index advisor is on by default with the index check, and the index check now also runs on SQLite, and on MySQL and MariaDB. They are listed first under "Changed" as behavior changes, with how to turn them off, as the pre-1.0 clause of the stability policy requires. A few other changes can break code that worked on 0.3.0 (the object max_queries() yields, the minimum SQLAlchemy, the labels of partitioned-table findings, --continue-on-collection-errors); they are listed under "Breaking changes" after the behavior changes.

Added#

Missing indexes

New findings and rules

Adopting it on an existing project

Ignoring and gating

Timing and budgets

Documentation and examples

Changed#

Behavior changes

The other new options are off by default and change nothing until you turn them on: queryguard_small_repeat_threshold, queryguard_write_loop_threshold, queryguard_unused_eager_load, queryguard_baseline, queryguard_fail_on (empty: every kind fails, as before) and --queryguard-sarif.

Breaking changes

These can break code or configuration that worked on 0.3.0.

Internals

Fixed#

0.4.0rc4 - 2026-10-13#

Fixed#

0.4.0rc3 - 2026-10-13#

Added#

Changed#

Fixed#

0.4.0rc2 - 2026-10-12#

Added#

Changed#

Fixed#

0.4.0rc1 - 2026-10-12#

Release candidate: install it with pip install --pre pytest-queryguard.

This release adds baselines, SARIF output and a GitHub Action, per-finding ignores, new finding kinds (column loads, write loops, unused eager loads), query timing and max_db_time, an index advisor, and a missing-index check for SQLite. It also adds a documentation site and runnable examples. Three things can change the result or the output of an existing test run without any new option: the column-load kind is on by default, the index advisor is on by default with the index check, and the index check now also runs on SQLite. They are listed first under "Changed" as behavior changes, with how to turn them off, as the pre-1.0 clause of the stability policy requires.

Added#

Missing indexes

New findings and rules

Adopting it on an existing project

Ignoring and gating

Timing and budgets

Documentation and examples

Changed#

Behavior changes

Everything else is off by default and changes nothing until you turn it on: queryguard_small_repeat_threshold, queryguard_write_loop_threshold, queryguard_unused_eager_load, queryguard_baseline, queryguard_fail_on (empty: every kind fails, as before) and --queryguard-sarif.

Internals

Fixed#

0.3.0 - 2026-10-11#

Added#

Changed#

Fixed#

0.2.0 - 2026-10-11#

Added#

Changed#

0.1.0 - 2026-10-11#

First release.

Added#

Edit this page on GitHub