{
  "slug": "sql-linter",
  "name": "gizza-ai/sql-linter",
  "version": "0.1.0",
  "title": "SQL Linter — find syntax issues and query anti-patterns — gizza.ai",
  "description": "Paste SQL to flag syntax issues plus SELECT *, comma joins, bare JOINs, and missing subquery aliases. Local, read-only linting.",
  "tags": [
    "sql linter",
    "sql anti pattern",
    "select star",
    "implicit join",
    "sql syntax checker",
    "query review",
    "database code review"
  ],
  "category": "developer",
  "urls": {
    "page": "https://gizza.ai/tools/sql-linter/",
    "markdown": "https://gizza.ai/tools/sql-linter/index.md",
    "descriptor": "https://gizza.ai/tools/sql-linter/tool.json",
    "deep_link_example": "https://gizza.ai/tools/sql-linter/?sql=SELECT%20%2A%0AFROM%20users%20u%2C%20orders%20o%0AJOIN%20payments%20p%20ON%20p.order_id%20%3D%20o.id%0AWHERE%20u.id%20%3D%20o.user_id%3B&dialect=generic&min_severity=all&ignore=SELECT-STAR%2C%20BARE-JOIN&format=text"
  },
  "cli": "gizza tool sql-linter \"SELECT *\nFROM users u, orders o\nJOIN payments p ON p.order_id = o.id\nWHERE u.id = o.user_id;\"",
  "tool": {
    "description": "Lint pasted SQL without executing it. Reports structural syntax problems (unbalanced parentheses, unterminated strings/comments, leading/trailing commas) plus common anti-patterns: SELECT *, implicit/comma joins, derived subqueries without aliases, and bare JOINs. Parameters: sql text, dialect hint (generic/mysql/postgresql/sqlite/tsql), min_severity filter, ignore list of rule codes, and text/json output.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "dialect": {
          "default": "generic",
          "description": "SQL dialect hint. The linter is intentionally heuristic, but the dialect controls details such as MySQL # line-comment masking and is reported in the output.",
          "enum": [
            "generic",
            "mysql",
            "postgresql",
            "sqlite",
            "tsql"
          ],
          "type": "string"
        },
        "format": {
          "default": "text",
          "description": "Output format. 'text' is a human-readable report with line numbers and snippets; 'json' returns summary counts plus a findings array.",
          "enum": [
            "text",
            "json"
          ],
          "type": "string"
        },
        "ignore": {
          "default": "",
          "description": "Optional comma- or space-separated rule codes to suppress, e.g. SELECT-STAR, BARE-JOIN, IMPLICIT-JOIN, SUBQUERY-NO-ALIAS, SYNTAX.",
          "type": "string"
        },
        "min_severity": {
          "default": "all",
          "description": "Minimum severity to show. 'all' includes info/warning/error findings; 'warning' hides info-only style hints; 'error' shows only structural syntax errors.",
          "enum": [
            "all",
            "warning",
            "error"
          ],
          "type": "string"
        },
        "sql": {
          "description": "SQL text to lint. Multiple statements are allowed; comments and string literals are masked before anti-pattern checks so examples inside comments do not trigger findings.",
          "type": "string"
        }
      },
      "required": [
        "sql"
      ],
      "type": "object"
    }
  }
}