-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
Hi, I have some question.
I want to collect and parse queries and make statistics by query pattern.
Query patterns should be collected in this form.
## AS-IS
select * from abc where x = 1
## TO-BE
select * from abc where x = ?As a test, I tried the following code, but a different query came out.
func main() {
stmt, err := sqlparser.Parse("select * from user_items where user_id=1 order by created_at limit 3 offset 10")
if err != nil {
panic(err)
}
q := sqlparser.GenerateParsedQuery(stmt).Query
fmt.Println(q)
}But, the result is as below.
select * from user_items where user_id = 1 order by created_at asc limit 10, 3please reply.
Thanks.
Chan.
Metadata
Metadata
Assignees
Labels
No labels