-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
First of all, thank you for creating such an amazing SQL parser library! GoSQLX is truly impressive with its high performance and comprehensive feature set. I really appreciate your hard work and dedication to this project. π
Bug Description
GoSQLX correctly supports double-quoted identifiers in SELECT statements, but fails to parse them in other SQL statement types (UPDATE, INSERT, DELETE, DROP, TRUNCATE, CREATE).
According to ANSI SQL standard, double-quoted identifiers should be supported in all SQL statement types.
Reproduction
package main
import (
"fmt"
"github.com/ajitpratap0/GoSQLX/pkg/gosqlx"
)
func main() {
tests := []string{
`SELECT * FROM "users"`, // β
Works
`DROP TABLE "users"`, // β Fails
`DELETE FROM "users" WHERE id=1`, // β Fails
`UPDATE "users" SET name='test'`, // β Fails
`INSERT INTO "users" (name) VALUES ('test')`, // β Fails
`TRUNCATE TABLE "users"`, // β Fails
`CREATE TABLE "users" (id INT)`, // β Fails
}
for _, sql := range tests {
_, err := gosqlx.Parse(sql)
if err != nil {
fmt.Printf("β %s\n Error: %v\n", sql, err)
} else {
fmt.Printf("β
%s\n", sql)
}
}
}Output
β
SELECT * FROM "users"
β DROP TABLE "users"
Error: parsing failed: Error E2002 at line 0, column 0: expected object name, got DOUBLE_QUOTED_STRING
β DELETE FROM "users" WHERE id=1
Error: parsing failed: Error E2002 at line 0, column 0: expected table name, got DOUBLE_QUOTED_STRING
β UPDATE "users" SET name='test'
Error: parsing failed: Error E2002 at line 0, column 0: expected table name, got DOUBLE_QUOTED_STRING
β INSERT INTO "users" (name) VALUES ('test')
Error: parsing failed: Error E2002 at line 0, column 0: expected table name, got DOUBLE_QUOTED_STRING
β TRUNCATE TABLE "users"
Error: parsing failed: Error E2002 at line 0, column 0: expected object name, got DOUBLE_QUOTED_STRING
β CREATE TABLE "users" (id INT)
Error: parsing failed: Error E2002 at line 0, column 0: expected object name, got DOUBLE_QUOTED_STRING
Expected Behavior
Double-quoted identifiers should be supported in all SQL statement types per ANSI SQL standard. This is critical for compatibility with:
- PostgreSQL (uses double quotes by default)
- ORMs like bun, GORM (generate double-quoted SQL)
Environment
- GoSQLX version: v1.6.0
- Go version: 1.25.5
Metadata
Metadata
Assignees
Labels
No labels