Skip to content

format, validate, lint commands treat inline SQL as file path unlike parse/analyze/optimize #290

@ajitpratap0

Description

@ajitpratap0

Description

CLI commands have inconsistent input handling:

  • parse "SELECT 1" — ✅ accepts inline SQL
  • analyze "SELECT 1" — ✅ accepts inline SQL
  • optimize "SELECT 1" — ✅ accepts inline SQL
  • format "SELECT 1" — ❌ treats argument as file path
  • validate "SELECT 1" — ❌ treats argument as file path
  • lint "SELECT 1" — ❌ treats argument as file path

Workaround

Pipe via stdin: echo "SELECT 1" | gosqlx format -

Expected

All commands should accept inline SQL as a positional argument, consistent with parse/analyze/optimize.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcli

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions