Repository navigation
v0.2.0
The CI gate release: adopt n1scan in a project that already has N+1 queries
and fail only on the ones a change adds.
Added
--report FILEwrites a versioned JSON document (n1scan/report/v1) or,
for.mdfiles, Markdown ready for a pull request comment. Findings have a
stableidderived from the normalised query.--baseline FILEcompares a run with an earlier report; with--cionly
findings that are not in the baseline fail.--update-baselinewrites it.
--fail-on new|worse|any,--fail-kindsand--allow-growthtune the gate.n1scan diff BASE HEAD(--format text|md|json) compares two reports and
refuses to call a result verified when the second run captured no queries,
the commands differ or the command failed (exit status 2).- GitHub Action (
uses: alex00010/n1scan@v0.2.0): downloads and checksums the
release binary on Linux, macOS and Windows runners, writes the job summary
and keeps one pull request comment up to date. skills/n1scan/SKILL.md: a before/after/diff protocol for coding agents.- New finding kind
batchablefor INSERT/UPDATE/DELETE once per row. It is
reported but does not fail--ciunless listed in--fail-kinds. n1scan help;bench/vs-sql-tapwith the benchmark script and results.- CI on Windows and macOS, a gofmt check, and a self-test of the action.
Changed
- Values are redacted by default everywhere: string, number and
dollar-quoted literals in SQL text, bound parameters and quoted parts of
server errors become?in the terminal, the live screen, JSON and reports.
--show-valuesshows them again. - With
--ci, a run in which no query went through the proxy now exits 2 and
says so, instead of printing "no N+1 patterns found". - Only
n+1findings fail--ciby default (write loops used to). - Fingerprint format 1 is now frozen and recorded in reports. It differs from
v0.1.0 in small ways:from (select,in (...)andvalues (...)keep
their space,-1and1share a shape, and= true/= falsebecome?.
Fixed
- A loop of slow statements (each longer than
--gap) was never reported,
because the burst was closed while the next statement was still running. - Lookups in separate tests that each end with
ROLLBACKwere merged into
one false N+1. - Unknown subcommands (
n1scan demo, typos) silently started the proxy; they
now print an error and exit 2.