opyeb sqllint

sqllint · Guides

SQL formatting and lint guides

Five articles on formatting rules, PostgreSQL, MySQL and SQLite differences, index-defeating patterns, DDL review and dangerous writes.

Five articles: formatting rules, dialect differences, conditions that defeat an index, a DDL review, and dangerous write statements.

Format and dialects

FormatHow the SQL formatter lays out a statementClause-per-line layout, indentation and comma choices, and comments that survive.DialectsPostgreSQL, MySQL and SQLite differencesIdentifier quoting, auto-increment, casts, LIMIT and case sensitivity.

Indexes and DDL

IndexesConditions that stop an index from being usedThe condition shapes that skip an index that exists, and how to rewrite them.

Safe writes

DDLReviewing CREATE TABLE through a summaryTurn DDL into a table and find the gaps in keys and indexes.SafetyDangerous writes, NOT IN and N+1 queriesSpot statements that rewrite a whole table and lookups that repeat in a loop.

Once you have read the explanation, check it against the tool.

Open the tool