Bug Description
gosqlx validate takes a dialect flag, but parse, format, lint and analyze do not.
To Reproduce
Steps to reproduce the behavior:
- Query:
SELECT * FROM t LIMIT 10, 20 (valid MySQL/SQLite syntax for specifying offset and count)
- Actual, produces error
- Expected: parsing the query works
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.
Bug Description
gosqlx validatetakes a dialect flag, butparse,format,lintandanalyzedo not.To Reproduce
Steps to reproduce the behavior:
SELECT * FROM t LIMIT 10, 20(valid MySQL/SQLite syntax for specifying offset and count)Error: parsing failed: Error E2002 at line 1, column 25: expected statement, got COMMACode Example
SQL Query
Expected Behavior
Valid queries work.
Actual Behavior
Valid queries result in a parsing error.
Environment
Additional Context
N/A
Possible Solution
Take a dialect flag, use
ParseWithDialectinstead ofParse.