mirror of
https://github.com/penpot/penpot.git
synced 2026-09-07 12:40:12 +00:00
✨ 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:
parent
b4b5e849e5
commit
f2adc944f3
@ -101,7 +101,8 @@ Graph Console
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<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">
|
<form id="graph-query-form" method="post" action="/dbg/actions/graph-query">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<textarea name="query" rows="8" style="width:100%; font-family: monospace;"
|
<textarea name="query" rows="8" style="width:100%; font-family: monospace;"
|
||||||
|
|||||||
@ -24,11 +24,17 @@
|
|||||||
(set! *warn-on-reflection* true)
|
(set! *warn-on-reflection* true)
|
||||||
|
|
||||||
(def default-query
|
(def default-query
|
||||||
"Default console query. The `filter_*` columns carry node ids for the
|
"Default console query, written to be self-explanatory in the textarea.
|
||||||
graph-view result filter; the results table hides them (see
|
The `filter_*` columns carry node ids for the graph-view result filter;
|
||||||
`hide-filter-columns` and the template's `renderQueryOutput`)."
|
the results table hides them (see `hide-filter-columns` and the
|
||||||
(str "MATCH (s)-[r]->(t) "
|
template's `renderQueryOutput`)."
|
||||||
"RETURN s.name, label(s) AS src, label(r) AS rel, t.name, label(t) AS tgt, "
|
(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;"))
|
"s.id AS filter_src_id, t.id AS filter_tgt_id;"))
|
||||||
|
|
||||||
(defonce ^:private sessions
|
(defonce ^:private sessions
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user