Skip to content

feat: add GQL extension - #38

Merged
adsharma merged 10 commits into
mainfrom
feature/gql-extension
Aug 11, 2026
Merged

feat: add GQL extension#38
adsharma merged 10 commits into
mainfrom
feature/gql-extension

Conversation

@adsharma

@adsharma adsharma commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Add GQL extension: CALL GQL('query') translating GQL to Cypher

  • Implements CALL GQL('query') as a standalone table function
  • Uses ISO GQL ANTLR grammar (from DuckDB GQL extension) for parsing
  • Translates GQL to equivalent Cypher via keyword-level transformations
    (e.g., INSERT -> CREATE) since GQL and Cypher share common syntax
  • Supports MATCH, RETURN, WHERE, ORDER BY, SKIP, LIMIT, path patterns
  • Registered as official extension 'GQL'

adsharma added 3 commits July 31, 2026 21:24
- Implements CALL GQL('<query>') as a standalone table function
- Uses ISO GQL ANTLR grammar (from DuckDB GQL extension) for parsing
- Translates GQL to equivalent Cypher via keyword-level transformations
  (e.g., INSERT -> CREATE) since GQL and Cypher share common syntax
- Supports MATCH, RETURN, WHERE, ORDER BY, SKIP, LIMIT, path patterns
- Registered as official extension 'GQL'
- MATCH RETURN, MATCH WHERE, path patterns, INSERT→CREATE
- Parse error and empty query error handling
adsharma added 7 commits July 31, 2026 22:03
- Strip PROPERTY and IF NOT EXISTS keywords (LadybugDB Cypher doesn't support them for CREATE GRAPH)
- Fix visitor dispatch by properly delegating visitChildren to base class
- Add tests for all CREATE GRAPH variants
- GQL INSERT translates to Cypher CREATE as before
When GQL parsing fails, pass the query through as raw Cypher so
LadybugDB-specific DDL (CREATE NODE TABLE, CREATE REL TABLE, etc.)
works via CALL GQL() without modification.

Add test cases for DDL fallback and end-to-end node+rel workflows.
…ors, keyword labels

- basic.test: SHOW_GRAPHS returns (name,type); update 3 expected rows to
  include the STANDARD type column (tests 56/57/60)
- basic.test: rename Product label to Item — Product lexes as the
  case-insensitive PRODUCT keyword in the OpenGQL grammar, breaking ANTLR
  parse of CALL GQL("INSERT (n:Product ...)") (test 65)
- gql_function.cpp: restrict the DDL pass-through fallback to a small
  allowlist (CREATE/DROP/ALTER NODE|REL|EDGE TABLE, COPY, LOAD FROM);
  other GQL syntax errors now raise 'Failed to parse GQL query: <query>'
  instead of leaking core Parser exceptions (test 58)
- gql_function.cpp/transformer: emulate 'CREATE GRAPH IF NOT EXISTS' by
  checking the graph catalog at rewrite time and no-opping when the graph
  already exists — LadybugDB Cypher has no IF NOT EXISTS for CREATE GRAPH
  (test 60)
@adsharma
adsharma merged commit e9fca2c into main Aug 11, 2026
2 checks passed
@adsharma
adsharma deleted the feature/gql-extension branch August 11, 2026 03:45
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.

1 participant