SQL Linter & Style Checker
A formatter fixes how SQL looks; a linter tells you what is wrong with it. This checker reads your statement and flags the problems that reviewers actually catch — an UPDATE with no WHERE clause, a NOT IN subquery that silently returns nothing when it hits a NULL, a function wrapped around an indexed column, a comma join whose predicate went missing, LIMIT with no ORDER BY — alongside style rules for keyword casing, line length and comma placement. Every rule runs in your browser, so nothing you paste leaves the page.
Do more than sql linter & style checker — meet Chat2DB
Chat2DB is an AI-powered SQL client for Windows, macOS and Linux. Write SQL in natural language, format and optimize queries automatically, and manage MySQL, PostgreSQL, Oracle and 20+ other databases in one workspace.
How to use
- Paste one or more SQL statements into the editor; the linter re-runs on every keystroke.
- Choose your dialect, the keyword case your team uses and a maximum line length so the style rules match your conventions.
- Work through the report from errors to info, using the fix hint on each finding, then re-check until the statement is clean.
Frequently asked questions
What is the difference between a SQL linter and a SQL formatter?
A formatter only changes whitespace and casing: it rewrites your query into a canonical layout without altering what the query does. A linter reads the query and reports problems — correctness traps such as an UPDATE with no WHERE clause or a NOT IN subquery that returns nothing when it encounters a NULL, performance traps such as a function applied to an indexed column, and style deviations such as inconsistent keyword casing. In practice teams run both: the formatter normalises the text and the linter gates the pull request. Tools like SQLFluff bundle the two; this page focuses on the linting half and runs entirely client-side.
Which SQL problems does this linter detect?
Correctness: comparing to NULL with = or <>, NOT IN against a subquery that can produce NULL, UPDATE or DELETE without a WHERE clause, a JOIN with no ON or USING clause, and COUNT(DISTINCT *). Performance: a leading wildcard in a LIKE pattern, functions applied to columns inside predicates, LIMIT without ORDER BY, and SELECT * in the projection. Schema: a CREATE TABLE with no primary key and, on dialects that require it, VARCHAR declared without a length. Style: keyword casing, tab indentation, trailing whitespace, over-long lines, leading commas, ordinal ORDER BY, mixed != and <> and missing statement terminators.
Is my SQL sent to a server?
No. The rules are plain JavaScript that runs in your browser tab, so the statement never leaves your machine and nothing is stored or logged. That makes it safe to paste production queries that contain table names or literal values you would not want to upload. If you want the same checks against a live connection — running EXPLAIN on the query the linter flagged, or browsing the schema behind it — Chat2DB is an AI SQL client for PostgreSQL, MySQL, Oracle and 20+ other engines; download it at https://chat2db.ai/download or open https://app.chat2db.ai in a browser.
