func main() { sql := "SELECT * FROM table WHERE a = 'abc'" stmt, err := sqlparser.Parse(sql) if err != nil { fmt.Printf("%s",err.Error()) } // Otherwise do something with stmt switch stmt := stmt.(type) { case *sqlparser.Select: _ = stmt case *sqlparser.Insert: } fmt.Printf("stmt :%v", stmt) } result err: syntax error at position 20 near 'table'
Activity
bramp commentedon Sep 10, 2021
xinlushi commentedon Sep 13, 2021
Please replace the example, this is the code of the example
Mrsandman327 commentedon Nov 14, 2022
There is a table in the database ‘information_schema’ as ‘tables’, this problem causes this table to be accessed abnormally