From 956ed98750c5371cc1ba6ada53b4beb7250515fb Mon Sep 17 00:00:00 2001 From: Taiki Koshino Date: Thu, 20 Aug 2026 02:10:59 +0900 Subject: [PATCH v1] doc: Reformat SELECT queries using GRAPH_TABLE The SELECT queries using GRAPH_TABLE in ddl.sgml and queries.sgml were written on single long lines, requiring horizontal scrolling. Break the queries across multiple lines to improve readability. --- doc/src/sgml/ddl.sgml | 14 ++++++++++++-- doc/src/sgml/queries.sgml | 7 ++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index 160f4eebb35..cb72e59b136 100644 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -5824,7 +5824,12 @@ CREATE PROPERTY GRAPH myshop This graph could then be queried like this: -- get list of customers active today -SELECT customer_name FROM GRAPH_TABLE (myshop MATCH (c IS customers)-[IS customer_orders]->(o IS orders WHERE o.ordered_when = current_date) COLUMNS (c.name AS customer_name)); +SELECT customer_name +FROM GRAPH_TABLE ( + myshop MATCH (c IS customers) + -[IS customer_orders]->(o IS orders WHERE o.ordered_when = current_date) + COLUMNS (c.name AS customer_name) +); corresponding approximately to this relational query: @@ -5888,7 +5893,12 @@ CREATE PROPERTY GRAPH myshop With this definition, we can write a query like this: -SELECT customer_name FROM GRAPH_TABLE (myshop MATCH (c IS customer)-[IS has_placed]->(o IS "order" WHERE o.ordered_when = current_date) COLUMNS (c.name AS customer_name)); +SELECT customer_name +FROM GRAPH_TABLE ( + myshop MATCH (c IS customer) + -[IS has_placed]->(o IS "order" WHERE o.ordered_when = current_date) + COLUMNS (c.name AS customer_name) +); With the new labels the MATCH clause is now more intuitive. diff --git a/doc/src/sgml/queries.sgml b/doc/src/sgml/queries.sgml index 3d729f983b5..c80d5115b06 100644 --- a/doc/src/sgml/queries.sgml +++ b/doc/src/sgml/queries.sgml @@ -2768,7 +2768,12 @@ SELECT * FROM t; Consider this example from : -- get list of customers active today -SELECT customer_name FROM GRAPH_TABLE (myshop MATCH (c IS customers)-[IS customer_orders]->(o IS orders WHERE o.ordered_when = current_date) COLUMNS (c.name AS customer_name)); +SELECT customer_name +FROM GRAPH_TABLE ( + myshop MATCH (c IS customers) + -[IS customer_orders]->(o IS orders WHERE o.ordered_when = current_date) + COLUMNS (c.name AS customer_name) +); The graph query part happens inside the GRAPH_TABLE construct. As far as the rest of the query is concerned, this acts like a -- 2.52.0