Make the default query self-explanatory; link the Cypher docs

The default query is now multi-line with // comments that explain the filter_* column convention in place (Kuzu accepts comments and blank lines mid-statement; verified against an in-memory database through the console query path). The query fieldset is retitled 'LadybugDB Cypher' with the Cypher word linking to https://docs.ladybugdb.com/cypher/.

Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>
This commit is contained in:
Álvaro Tejero Cantero 2026-07-16 10:43:56 +02:00
parent b4b5e849e5
commit f2adc944f3
No known key found for this signature in database
2 changed files with 13 additions and 6 deletions

View File

@ -101,7 +101,8 @@ Graph Console
</fieldset>
<fieldset>
<legend>Cypher query</legend>
<legend>LadybugDB <a href="https://docs.ladybugdb.com/cypher/"
target="_blank">Cypher</a></legend>
<form id="graph-query-form" method="post" action="/dbg/actions/graph-query">
<div class="row">
<textarea name="query" rows="8" style="width:100%; font-family: monospace;"

View File

@ -24,11 +24,17 @@
(set! *warn-on-reflection* true)
(def default-query
"Default console query. The `filter_*` columns carry node ids for the
graph-view result filter; the results table hides them (see
`hide-filter-columns` and the template's `renderQueryOutput`)."
(str "MATCH (s)-[r]->(t) "
"RETURN s.name, label(s) AS src, label(r) AS rel, t.name, label(t) AS tgt, "
"Default console query, written to be self-explanatory in the textarea.
The `filter_*` columns carry node ids for the graph-view result filter;
the results table hides them (see `hide-filter-columns` and the
template's `renderQueryOutput`)."
(str "MATCH (s)-[r]->(t)\n"
"// WHERE some condition\n"
"RETURN label(s) AS src, s.name,\n"
" label(r) AS rel,\n"
" t.name, label(t) AS tgt,\n"
"\n"
"// filter_* columns omitted from table; these needed for graph view\n"
"s.id AS filter_src_id, t.id AS filter_tgt_id;"))
(defonce ^:private sessions