-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Is your feature request related to a problem? Please describe.
It seems that spansql package which is used in Spanner support is not actively developed.
googleapis/google-cloud-go#11115
Many of the issues opened due to spansql's lack of support for Spanner SQL syntax.
- Support float32 type for spanner #1264
- Support Default on Google Cloud Spanner #918
- Dropping spanner tables which has row deletion policy #844
- spanner CHANGE STREAM #775
- Module update needed (Cloud Spanner parsing issue) #767
- JSON field type rejected #710
(Although I think some issues are already resolved in latest spansql.)
Describe the solution you'd like
Migrating to another Spanner SQL parser implementation is a solution.
I recommend to consider cloudspannerecosystem/memefish.
Whose Spanner SQL coverage is already superset of spansql.
Describe alternatives you've considered
Current usage of spansql is only splitting DDL statements and strip comments.
migrate/database/spanner/spanner.go
Lines 343 to 347 in c378583
func cleanStatements(migration []byte) ([]string, error) { | |
// The Spanner GCP backend does not yet support comments for the UpdateDatabaseDdl RPC | |
// (see https://issuetracker.google.com/issues/159730604) we use | |
// spansql to parse the DDL and output valid stamements without comments | |
ddl, err := spansql.ParseDDL("", string(migration)) |
I think it can be implemented without full syntax parsing using only a lexer.