Proposal: Implement statement separator without spansql to fix parse errors
Opened this issue · 0 comments
apstndb commented
WHAT
There is a motivation to replace spansql with a more primitive implementation.
I want to discuss it.
WHY
Currently, wrench can't process statements which are not supported by spansql because of the spansql dependency.
spansql is used in ddlToStatements
, dmlToStatements
.
https://github.com/cloudspannerecosystem/wrench/blob/v1.4.1/pkg/spanner/migration.go#L144-L170
spansql is not actively maintained by Google and not 100% compatible with Cloud Spanner DDL/DML so the dependency on spansql makes it complex for wrench to support the new features of Cloud Spanner.
Reference
- Cloud Spanner Standard SQL lexical structure
- https://cloud.google.com/spanner/docs/reference/standard-sql/lexical?hl=en
- We should only think about comments and literals.
- spansql is introduced to support DDLs/DMLs with comments.
- spanner-cli implements statement separator with comment strip
- cloudspannerecosystem/spanner-cli#33
- cloudspannerecosystem/spanner-cli#34
- I think wrench can reuse this implementation.