cwida / duckpgq-extension

DuckDB extension that adds support for SQL/PGQ
https://duckpgq.notion.site/b8ac652667964f958bfada1c3e53f1bb?v=3b47a8d44bdf4e0c8b503bf23f1b76f2
MIT License
72 stars 7 forks source link

Support WITH clause GRAPH_TABLE #130

Closed Dtenwolde closed 3 months ago

Dtenwolde commented 3 months ago

Fixes #129

This PR adds the ability to use the FROM GRAPH_TABLE inside a WITH clause.

Couple of examples:

WITH foo AS (
    SELECT id 
    FROM GRAPH_TABLE(snb MATCH (a:Person))
)
SELECT * 
FROM foo 
LIMIT 10;

WITH foo AS (
    FROM GRAPH_TABLE(snb MATCH (a:Person)-[r:Knows]->(b:Person) 
    COLUMNS (a.id AS id, b.id AS knows_id)
)
SELECT * 
FROM foo 
LIMIT 10;