Run Cypher queries from the rdx console#883
Open
paracycle wants to merge 2 commits into
Open
Conversation
paracycle
force-pushed
the
uk_add_cypher_query_engine
branch
from
June 25, 2026 20:31
f6e2615 to
7e08a7b
Compare
paracycle
force-pushed
the
uk_rdx_console_query_mode
branch
2 times, most recently
from
June 25, 2026 20:33
e8308d4 to
9306fe5
Compare
paracycle
force-pushed
the
uk_rdx_console_query_mode
branch
6 times, most recently
from
July 3, 2026 21:02
c41173d to
19a7ce6
Compare
paracycle
force-pushed
the
uk_add_cypher_query_engine
branch
from
July 3, 2026 21:16
ded5eb9 to
4fa3719
Compare
paracycle
force-pushed
the
uk_rdx_console_query_mode
branch
2 times, most recently
from
July 3, 2026 21:32
6132b4a to
63488b8
Compare
paracycle
force-pushed
the
uk_add_cypher_query_engine
branch
3 times, most recently
from
July 3, 2026 21:56
85bbbba to
cc553f6
Compare
paracycle
force-pushed
the
uk_rdx_console_query_mode
branch
2 times, most recently
from
July 8, 2026 16:50
622970f to
7b27f69
Compare
paracycle
changed the base branch from
uk_add_cypher_query_engine
to
uk_query_object_results
July 8, 2026 16:50
paracycle
force-pushed
the
uk_query_object_results
branch
from
July 8, 2026 18:26
d68b816 to
51b4f05
Compare
paracycle
force-pushed
the
uk_rdx_console_query_mode
branch
from
July 8, 2026 18:28
7b27f69 to
c3e332e
Compare
paracycle
force-pushed
the
uk_query_object_results
branch
from
July 8, 2026 20:05
51b4f05 to
2bb59e0
Compare
paracycle
force-pushed
the
uk_rdx_console_query_mode
branch
from
July 8, 2026 20:06
c3e332e to
d2e3c09
Compare
paracycle
force-pushed
the
uk_query_object_results
branch
from
July 8, 2026 20:19
2bb59e0 to
1de091c
Compare
paracycle
force-pushed
the
uk_rdx_console_query_mode
branch
from
July 8, 2026 20:19
d2e3c09 to
825248e
Compare
paracycle
force-pushed
the
uk_query_object_results
branch
from
July 9, 2026 20:13
1de091c to
ae8fcbd
Compare
paracycle
force-pushed
the
uk_rdx_console_query_mode
branch
from
July 9, 2026 20:13
825248e to
10e1f88
Compare
paracycle
force-pushed
the
uk_query_object_results
branch
from
July 9, 2026 20:56
ae8fcbd to
9e80825
Compare
paracycle
force-pushed
the
uk_rdx_console_query_mode
branch
from
July 9, 2026 20:57
10e1f88 to
dc2c413
Compare
paracycle
force-pushed
the
uk_query_object_results
branch
from
July 9, 2026 21:17
9e80825 to
5fb40e7
Compare
paracycle
force-pushed
the
uk_rdx_console_query_mode
branch
from
July 9, 2026 21:18
dc2c413 to
47450a6
Compare
Add an object-returning `Rubydex::Query#run(graph)` alongside the string-returning `Query#render`. Where `render` formats rows into a table or JSON string, `run` returns an `Array<Hash>` whose values are real Ruby objects — including `Declaration`/`Definition`/`Document` handles for node columns, and Hashes for map projections — so callers can navigate the graph directly instead of re-parsing formatted text. Targets `cypher-parser` 0.8: - structured node results (`CypherValue::Node`) surfaced through the FFI as handle-buildable cells, plus `CypherValue::Map` -> Ruby Hash. - implement the new `GraphProvider::expand_in` for the cheap, exact reverse edges (a definition's document, a declaration's definitions), turning those incoming traversals from a whole-graph build into direct lookups; other edges fall back to the default reverse-adjacency build.
paracycle
force-pushed
the
uk_query_object_results
branch
from
July 9, 2026 22:39
5fb40e7 to
933bf3d
Compare
Add `Rubydex::Console`, which backs `rdx console` with an IRB session that keeps `graph` in scope (for Ruby, e.g. `graph["Foo"]`) and registers two Cypher commands via IRB's modern command API: rubydex> query MATCH (n:Class|Module) RETURN n.name ORDER BY n.name rubydex> schema The `query` command takes the rest of the line verbatim, so the Cypher does not need to be valid Ruby or quoted. This is the clean, idiomatic "query mode": rather than swapping the REPL's evaluator, Cypher lines are prefixed with `query`. - Extract the console out of exe/rdx into lib/rubydex/console.rb; the query-running logic lives in Console.run_query so it is testable without driving IRB. - Treat IRB as a soft, runtime dependency rather than a gemspec one. IRB is a default gem, so it is not declared in the gemspec; the Cypher commands register only when the installed IRB exposes the command API (>= 1.13), and the console degrades to a plain Ruby session on older versions.
paracycle
force-pushed
the
uk_rdx_console_query_mode
branch
from
July 9, 2026 22:40
47450a6 to
140980d
Compare
paracycle
force-pushed
the
uk_query_object_results
branch
from
July 16, 2026 20:18
933bf3d to
a22a461
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Let
rdx consolerun Cypher directly, addressing the "query mode" idea from #868's review.Stacked on #868 (base
uk_add_cypher_query_engine).What it does
On top of the normal IRB session (with
graphin scope for Ruby, e.g.graph["Foo"]), it registers two commands:The
querycommand takes the rest of the line verbatim, so the Cypher doesn't need to be valid Ruby or quoted. Rather than swapping the REPL's evaluator for a modal toggle, Cypher lines are simply prefixed withquery— the clean, idiomatic IRB realization of a query mode.Notes
lib/rubydex/console.rb; the query path lives inConsole.run_queryso it's testable without driving IRB.Query#render(string output). Once an object-returningQuery#runlands,querycould return real handle objects instead of a printed table.Verification
rake ruby_test TEST=test/console_test.rb(7 tests), rubocop clean, live console smoke test.