Support With Clause
https://dev.mysql.com/doc/refman/8.0/en/with.html#common-table-expressions-syntax
Hi, could I check if there are any recent plans for WITH statements to be supported?
I think an alternative workaround here is to use the parser in the Vitess project directly. Since PR https://github.com/vitessio/vitess/pull/8918 it "Add parsing for common table expressions using WITH clause"
I think the SQL Parser can be imported with import "vitess.io/vitess/go/vt/sqlparser" - but I think the API is different - it doesn't seem to have a sqlparser.Parse('[string of SQL]') method any more.
EDIT I got this working. You can see how I used it here: https://github.com/grafana/grafana/pull/96296/commits/3d952d074e541cf496a06241e8de0fe35b5757ec
It works fine on CTEs 🎉
There's a second alternative workaround too - use DoltHub's hard-fork of the Vitess project, which is this one:
github.com/dolthub/[email protected]
I got this working too, here: https://github.com/grafana/grafana/pull/96296/commits/45f9adf845baa030e74cc14e18d12b9453bd17d3