Semantic SQL validation — catches the logic errors linters miss.
SQL that runs is the most dangerous SQL. It doesn't crash. It returns wrong
numbers that drive real decisions.
SQLFluff checks style. SafeSQL Pro checks logic. On save, this extension
validates the active .sql file against 33 deterministic detectors and
underlines the offending clause — before the query ever reaches your warehouse.
What it catches
AGGREGATE_OVER_FANOUT_JOIN — a JOIN multiplies rows before SUM()
LEFT_JOIN_FILTERED_IN_WHERE — a WHERE clause silently turns a LEFT JOIN into an INNER JOIN
Set safesql.apiKey in VS Code settings — or export SAFESQL_PRO_API_KEY,
which takes precedence and keeps the key out of settings.json.
Save a .sql file.
Without a key the extension does not fail — it shows a one-time prompt with
Open Settings and Get an API key, and stays quiet after that.
Settings
Setting
Default
Description
safesql.apiKey
—
SafeSQL Pro API key
safesql.threshold
70
Score below which validation is failing (0–100)
safesql.dialect
postgresql
postgresql | mysql | bigquery | snowflake
safesql.validateOnSave
true
Validate automatically on save
safesql.schemaFile
—
DDL file, relative to the workspace root
safesql.baseUrl
—
Override the API origin
Verdict bands
Score
Verdict
Meaning
0–40
CRITICAL
Hard error — unknown column/table, cartesian, destructive
41–69
RISKY
High-risk semantic warning — fan-out, LEFT JOIN in WHERE
70–84
REVIEW
Medium warning — integer division, COUNT after join
85–100
CLEAN
Suggestions only
Build the .vsix
cd sdk && npm install && npm run build # the extension depends on the SDK
cd ../vscode-extension
npm install
npm run package # → safesql-pro-0.1.0.vsix
code --install-extension safesql-pro-0.1.0.vsix
Publish (requires the mpingosystems publisher account):