Skip to content

[BUG] parse, format, lint and analyze do not take a dialect flag like validate does #523

Description

@mem

Bug Description

gosqlx validate takes a dialect flag, but parse, format, lint and analyze do not.

To Reproduce

Steps to reproduce the behavior:

  1. Query: SELECT * FROM t LIMIT 10, 20 (valid MySQL/SQLite syntax for specifying offset and count)
  2. Actual, produces error
  3. Expected: parsing the query works
  4. Error: parsing failed: Error E2002 at line 1, column 25: expected statement, got COMMA

Code Example

// Your code here
None, I'm trying with the gosqlx CLI tool

SQL Query

-- Your SQL query that causes the issue
SELECT * FROM t LIMIT 10, 20

Expected Behavior

Valid queries work.

Actual Behavior

Valid queries result in a parsing error.

Environment

  • OS: Linux
  • Go Version: 1.26
  • GoSQLX Version: v1.14.0

Additional Context

N/A

Possible Solution

Take a dialect flag, use ParseWithDialect instead of Parse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions