$ gcloud spanner databases execute-sql ${SPANNER_DATABASE} --sql '(WITH cte AS (SELECT 1 AS n) SELECT * FROM cte)'
n
1
but, memefish can't parse it.
$ go run ./tools/parse/main.go --mode query "(WITH cte AS (SELECT 1 AS n) SELECT * FROM cte)"
2024/11/13 23:35:51 syntax error: :1:2: expected token: SELECT, but: WITH
1: (WITH cte AS (SELECT 1 AS n) SELECT * FROM cte)
^~~~
exit status 1
It is a valid query.
but, memefish can't parse it.
Related syntax
https://cloud.google.com/spanner/docs/reference/standard-sql/query-syntax#sql_syntax
Considerations