Skip to content

Commit 274e3d8

Browse files
Fix stale README numbers and drop the archived SQL Ops Reviewer
Version 0.7.0 to 0.9.0, tests 277 to 303, and one consistent rule count (48, or 53 with the contracts pack) instead of the 44/43/31 the page gave in different places. Replace the two-layer pipeline built on the now-archived sql-ops-reviewer with sql-sop's own pre-commit and CI story, fix the pre-commit hook id (sql-sop, not sql-guard) and the action reference, and point the AI-integration row at sql-sop-mcp.
1 parent 5fd81d4 commit 274e3d8

1 file changed

Lines changed: 22 additions & 71 deletions

File tree

README.md

Lines changed: 22 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@ One bad SQL query can delete production data, expose customer records, or bring
4242

4343
| | |
4444
|---|---|
45-
| Rules | 44 (10 errors, 29 warnings, 5 Python-source); 49 with `--contract` |
46-
| Tests | 277 |
47-
| Coverage | 86% |
45+
| Rules | 48 (9 errors, 25 warnings, 3 structural, 6 T-SQL, 5 Python-source); 53 with `--contract` |
46+
| Tests | 303 |
4847
| Scan speed | 0.08s across 200 files |
49-
| PyPI downloads | 500+/month |
50-
| Version | 0.7.0 |
48+
| PyPI installs | 2,000+ (mirrors excluded) |
49+
| Version | 0.9.0 |
5150

5251
### Fluent API (v0.2.0)
5352

@@ -61,13 +60,13 @@ print(result.summary()) # "1 error, 0 warnings in 1 statement"
6160

6261
---
6362

64-
Fast, rule-based SQL linter. 43 rules (38 SQL + 5 Python), with an optional Contracts pack (5 schema-aware rules) when you supply `--contract path.yml`. SQL Server-focused rules for T-SQL shops. Inline disable, project config, git-changed-only mode, and SARIF output for GitHub Code Scanning. 500+ monthly downloads on PyPI.
63+
Fast, rule-based SQL linter. 48 rules (43 SQL + 5 Python), with an optional Contracts pack (5 schema-aware rules) when you supply `--contract path.yml`. SQL Server-focused rules for T-SQL shops. Inline disable, project config, git-changed-only mode, and SARIF output for GitHub Code Scanning. 2,000+ installs on PyPI.
6564

6665
Catches dangerous SQL before it reaches production -- DELETE without WHERE, UPDATE without WHERE, SQL injection patterns, SELECT *, contract drift, and 40+ more. Runs as a **CLI tool**, **pre-commit hook**, and **GitHub Action**.
6766

6867
Built to catch dangerous patterns like DELETE without WHERE before they ever reach a production database.
6968

70-
For deeper AI-powered analysis, pair with [SQL Ops Reviewer](https://github.com/Pawansingh3889/sql-ops-reviewer).
69+
Want the same rules inside your AI assistant? [sql-sop-mcp](https://github.com/Pawansingh3889/sql-sop-mcp) exposes them over MCP, so the model is told a query is unsafe before it suggests it.
7170

7271
---
7372

@@ -96,63 +95,28 @@ queries/create_orders.sql
9695
Found 2 issues (1 error, 1 warning) in 1 file (0.001s)
9796
```
9897

99-
## The two-layer SQL quality pipeline
98+
## Where sql-sop runs
10099

101-
Most teams have **no SQL review process**. Some use an AI linter. The problem: AI is slow, expensive, and overkill for catching `DELETE FROM users;`.
100+
Most teams have **no SQL review process** at all. sql-sop gives you one in two places, both driven by the same rules:
102101

103-
sql-sop and SQL Ops Reviewer solve this together:
102+
- **Pre-commit** -- runs in under 0.2s on the files you changed, so a bad `DELETE FROM users` is blocked before it is ever committed.
103+
- **CI** -- runs on every pull request and uploads SARIF, so findings appear inline in the GitHub "Files changed" view through Code Scanning.
104104

105-
```
106-
┌─────────────────────────────────────┐
107-
│ YOUR SQL FILE │
108-
└──────────────┬──────────────────────┘
109-
110-
┌────────────────────────┼────────────────────────┐
111-
│ │ │
112-
▼ │ │
113-
LAYER 1: PRE-COMMIT │ LAYER 2: CI
114-
───────────────── │ ──────────
115-
sql-guard │ SQL Ops Reviewer
116-
117-
When: before every commit │ When: on every PR
118-
Speed: <0.2 seconds │ Speed: 10-40 seconds
119-
How: regex pattern matching │ How: Ollama LLM analysis
120-
Needs: nothing (pure Python) │ Needs: 4-7 GB (AI model)
121-
Catches: 80% of issues │ Catches: remaining 20%
122-
123-
✓ DELETE without WHERE │ ✓ wrong JOIN type
124-
✓ SELECT * │ ✓ business logic errors
125-
✓ SQL injection patterns │ ✓ schema-aware suggestions
126-
✓ missing LIMIT │ ✓ cross-table consistency
127-
✓ DROP without IF EXISTS │ ✓ performance rewrites
128-
│ │ │
129-
▼ │ ▼
130-
commit blocked or passes │ PR comment with findings
131-
│ │ │
132-
└────────────────────────┼────────────────────────┘
133-
134-
135-
CLEAN SQL IN PRODUCTION
136-
```
137-
138-
**Layer 1 (sql-guard)** is a smoke detector -- always on, instant, catches fire fast.
139-
**Layer 2 (SQL Ops Reviewer)** is a fire inspector -- thorough, comes on every PR.
140-
141-
You want both.
105+
Same engine in both, no AI, no API keys, nothing to host. Fast enough to sit in the commit path, strict enough to gate a PR.
142106

143107
---
144108

145-
## Set up the full pipeline (5 minutes)
109+
## Set up (5 minutes)
146110

147-
### Step 1: Pre-commit hook (Layer 1)
111+
### Step 1: Pre-commit hook
148112

149113
```yaml
150114
# .pre-commit-config.yaml
151115
repos:
152-
- repo: https://github.com/Pawansingh3889/sql-guard
153-
rev: v0.7.0
116+
- repo: https://github.com/Pawansingh3889/sql-sop
117+
rev: v0.9.0
154118
hooks:
155-
- id: sql-guard
119+
- id: sql-sop
156120
args: [--severity, error] # only block on errors locally
157121
```
158122
@@ -161,9 +125,9 @@ pip install pre-commit
161125
pre-commit install
162126
```
163127

164-
Now every `git commit` with `.sql` changes runs sql-guard automatically. Errors block the commit. Warnings are shown but don't block.
128+
Now every `git commit` with `.sql` changes runs sql-sop automatically. Errors block the commit. Warnings are shown but don't block.
165129

166-
### Step 2: GitHub Actions (Layer 1 + Layer 2)
130+
### Step 2: GitHub Actions
167131

168132
```yaml
169133
# .github/workflows/sql-quality.yml
@@ -177,29 +141,16 @@ permissions:
177141
pull-requests: write
178142

179143
jobs:
180-
# Layer 1: fast rule check (~2 seconds)
181144
lint:
182145
runs-on: ubuntu-latest
183146
steps:
184147
- uses: actions/checkout@v4
185-
- uses: Pawansingh3889/sql-guard@v1
148+
- uses: Pawansingh3889/sql-sop@v1
186149
with:
187150
severity: warning
188-
189-
# Layer 2: deep AI review (~30 seconds, runs after lint passes)
190-
review:
191-
needs: lint
192-
runs-on: ubuntu-latest
193-
steps:
194-
- uses: actions/checkout@v4
195-
- uses: Pawansingh3889/sql-ops-reviewer@v1
196-
with:
197-
github-token: ${{ secrets.GITHUB_TOKEN }}
198151
```
199152
200-
That's it. Two files. Every SQL change gets:
201-
1. Instant rule-based lint (sql-guard)
202-
2. Deep AI review with fix suggestions (SQL Ops Reviewer)
153+
That's it. Every SQL change gets an instant, rule-based lint on the PR.
203154
204155
### Step 3 (optional): CLI for manual checks
205156
@@ -441,13 +392,13 @@ In a regulated data environment, sql-sop runs as a pre-commit hook on all SQL th
441392
442393
| | sql-sop | sqlfluff | sql-lint |
443394
|---|---|---|---|
444-
| Rules | 31 (focused) | 800+ (comprehensive) | ~20 |
395+
| Rules | 48 (focused) | 800+ (comprehensive) | ~20 |
445396
| Speed | <0.1s for 200 files | 45s for 200 files | ~2s |
446397
| Config needed | Zero | Extensive | Minimal |
447398
| Language | Python | Python | JavaScript |
448399
| Pre-commit | Yes | Yes | No |
449400
| GitHub Action | Yes | Community | No |
450-
| AI integration | Pairs with SQL Ops Reviewer | No | No |
401+
| AI integration | MCP server (sql-sop-mcp) | No | No |
451402
452403
sql-sop is not a replacement for sqlfluff. It's a fast first pass that catches 80% of real issues with zero setup. If you need dialect-specific formatting and 800 rules, use sqlfluff. If you want instant feedback on dangerous SQL, use sql-guard.
453404

0 commit comments

Comments
 (0)