Skip to content

Releases: Pawansingh3889/sql-sop

v0.9.0

Choose a tag to compare

@github-actions github-actions released this 01 Jun 19:32
069b902

0.9.0 (2026-05-31)

Features

  • dbt-aware rule pack scaffolding + DBT001 model-without-test (#57) (7ee1371)
  • rules: add W025 assertion-malformed (#53) (98caa6d)

Documentation

  • readme: add Companion tools section linking OpsMind and the compliance dashboard (#58) (d8f6c0f)

v0.8.0

Choose a tag to compare

@github-actions github-actions released this 20 May 20:20
v0.8.0
02f77f7

What's Changed

  • docs: refresh README and action.yml for v0.7.0 (contracts pack, new c… by @Pawansingh3889 in #38
  • feat(rules): add W021 having-without-group-by by @mvanhorn in #39
  • Fix S001 implicit-cross-join false negatives (aliases, schema-qual, multi-line) by @Pawansingh3889 in #46
  • Add E009 update-from-without-join (T-SQL implicit-join Cartesian risk) by @Pawansingh3889 in #47
  • Add T006 select-into-without-typed-fields (T-SQL runtime schema inference) by @Pawansingh3889 in #48
  • Add W024 select-distinct-suspicious (DISTINCT + JOIN band-aid heuristic) by @Pawansingh3889 in #49
  • Replace strict Conventional Commits PR-title check with a sanity check by @Pawansingh3889 in #50
  • chore: exclude test fixtures from the sql-sop dogfooding pre-commit hook by @Pawansingh3889 in #51
  • chore: add Release Please workflow and ADR issue template by @Pawansingh3889 in #55
  • chore(main): release 0.8.0 by @Pawansingh3889 in #56

Full Changelog: v0.7.0...v0.8.0

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 02 May 12:32
v0.7.0
48d5eea

v0.7.0 is the headline release for the Contracts theme: schema-aware linting via the new C001-C005 rule pack, two new CLI subcommands, and three community-contributed rules. No breaking changes. Without --contract the tool behaves identically to v0.6.x.

Highlights

Contracts pack (C001-C005)

Declare your expected schema in YAML and lint queries against it:

sql-sop check . --contract contract.yml

The five new rules:

  • C001 column-not-in-contract (warning) — SQL references a column that is not declared in the contract for that table.
  • C002 table-not-in-contract (warning) — statement touches a table not declared in the contract.
  • C003 not-null-violation (error) — INSERT omits a column the contract marks as NOT NULL with no default.
  • C004 primary-key-missing-on-insert (error) — INSERT omits a primary-key column that has no default.
  • C005 unmapped-fk (warning) — JOIN predicate uses two columns the contract has no foreign-key relationship for.

Contract format is a thin subset of the open data-contract spec. Contract path can also live in .sql-guard.yml via a contract: field.

New subcommands

Bootstrap a contract from a live database (requires sql-sop[snapshot]):

sql-sop schema-snapshot --dsn "mssql+pyodbc://..." --output contract.yml

Validate the YAML before running rules (CI-friendly):

sql-sop validate-contract --contract contract.yml

schema-snapshot introspects tables, columns, PKs, FKs, and nullable flags via SQLAlchemy. validate-contract exits non-zero on parse failure, so a malformed contract fails fast in CI.

Community-contributed rules

  • W014 case-without-else — warns when a CASE ... END block has no ELSE branch. Walks token-by-token tracking nesting. Contributed by @hellozzm in #32.
  • W015 join-function-on-column — JOIN-side companion to W003. Catches JOIN ... ON UPPER(o.email) = UPPER(c.email) patterns that defeat indexes. Contributed by @mvanhorn in #33.
  • W022 cross-join-explicit — flags explicit CROSS JOIN. Strips trailing line comments before matching. Contributed by @vibeyclaw in #31.
  • W023 scalar-udf-in-where — warns on schema-prefixed UDF calls in WHERE / HAVING / ON clauses, the canonical T-SQL scalar-UDF anti-pattern. Contributed by @mvanhorn in #34. Resolves #30.

Rule counts

  • Core registry: 43 rules (10 errors, 28 warnings, 5 Python-source)
  • With --contract: 48 rules (12 errors, 31 warnings, 5 Python-source)

Backwards compatibility

No breaking changes. All Contracts-pack rules require an explicit --contract flag (or contract: field in .sql-guard.yml); silent without it. The [snapshot] extra is opt-in via pip install "sql-sop[snapshot]" so SQLAlchemy stays out of the core install.

Install

pip install sql-sop==0.7.0

For the schema-snapshot subcommand: pip install "sql-sop[snapshot]==0.7.0"

For the pre-commit hook, set rev: v0.7.0 in your .pre-commit-config.yaml.


What's Changed

  • feat(rules): add W023 scalar-udf-in-where by @mvanhorn in #34
  • feat(rules): add W015 join-function-on-column by @mvanhorn in #33
  • feat: add W014 case-without-else rule by @hellozzm in #32
  • feat: add W022 cross-join-explicit rule by @vibeyclaw in #31
  • feat: contracts pack (C001-C005) + schema-snapshot + validate-contract subcommands by @Pawansingh3889 in #35
  • chore: release v0.7.0 contracts pack, schema-snapshot, validate-contract by @Pawansingh3889 in #36

New Contributors

Full Changelog: v0.6.2...v0.7.0

v0.6.2

Choose a tag to compare

@github-actions github-actions released this 27 Apr 05:59
v0.6.2
64b5063

What's Changed

New Contributors

Full Changelog: v0.6.1...v0.6.2

v0.6.1

Choose a tag to compare

@github-actions github-actions released this 26 Apr 12:07
v0.6.1
9ea87ad

What's Changed

  • feat(rules): add W019 count-distinct-unbounded rule by @mvanhorn in #29

Full Changelog: v0.6.0...v0.6.1

v0.6.0

Choose a tag to compare

@github-actions github-actions released this 26 Apr 07:07
v0.6.0
3f5df68

What's Changed

  • feat(rules): add W016 not-in-with-subquery rule by @mvanhorn in #26
  • feat(rules): add P005 sqlalchemy-text-fstring rule by @tmchow in #25

Full Changelog: v0.5.0...v0.6.0

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 20 Apr 01:24
a507f00

What's Changed

New Contributors

Full Changelog: v0.4.1...v0.5.0

v0.4.1

Choose a tag to compare

@github-actions github-actions released this 19 Apr 07:23
v0.4.1
26bd7cb

Full Changelog: v0.4.0...v0.4.1

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 18 Apr 09:00