Skip to content

Proposal: Migrate parser library in Spanner support from spansql to memefish #1194

Open
@apstndb

Description

@apstndb

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.

(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.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions