Skip to content

feat: support GQL MATCH and graph patterns - #379

Merged
makenowjust merged 8 commits into
cloudspannerecosystem:mainfrom
apstndb:feat/gql-part3-match-patterns
Jul 22, 2026
Merged

feat: support GQL MATCH and graph patterns#379
makenowjust merged 8 commits into
cloudspannerecosystem:mainfrom
apstndb:feat/gql-part3-match-patterns

Conversation

@apstndb

@apstndb apstndb commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This PR adds support for the GQL MATCH statement:

  • [OPTIONAL] MATCH statements
  • Full graph patterns
  • First-class standalone graph-pattern parsing through both
    memefish.ParseGQLGraphPattern and (*Parser).ParseGQLGraphPattern
  • Typed recovery through ast.GQLGraphPatternNode: valid input returns
    *ast.GQLGraphPattern, while malformed input returns a safe
    *ast.BadGQLGraphPattern together with the parse error
  • gql and gql_graph_pattern support in tools/parse

The recovered graph-pattern node is safe to unparse, inspect positions, and
walk. It preserves malformed tokens materialized by the lexer, including
first-token string-literal errors. Recovery for a whole GQL graph query remains
separate and is tracked by #383.

Validation

  • make ci
  • Checked against the Cloud Spanner graph-pattern reference, current
    google/googlesql grammar and parser tests, and the embedded Spanner
    emulator:
    • path variables compose with path search prefixes
    • prefix-like non-reserved keywords can be path variable names
    • edge-only subpaths such as (->) are accepted
    • empty property filters such as (n {}) are syntax errors

Related Issues

Comment thread ast/ast.go Outdated
@apstndb
apstndb requested a review from makenowjust July 20, 2026 06:07

@makenowjust makenowjust left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing a big feature!

@apstndb
apstndb requested a review from makenowjust July 20, 2026 15:27
@makenowjust
makenowjust merged commit 4842adc into cloudspannerecosystem:main Jul 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants