You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Query parameters in interactive mode (:param) (#98)
* feat: Add :param command for query parameters in interactive mode
Add cypher-shell-style query parameters to the interactive REPL:
:param <name> <expression> set a parameter to a server-evaluated value
:params list all set parameters
:params clear remove all parameters
Expressions are evaluated server-side via RETURN, giving full Cypher type
support, and may reference previously set parameters. Set parameters are
passed to every subsequent query via mg_session_run.
The parser (ParseParamCommand) and parameter store (ParamStore) live in a
new mgclient-only `params` library and are covered by unit tests. mg_memory
is extracted into its own header so the library and its test don't depend on
replxx. The REPL wiring (dispatch, server-eval, ExecuteQuery params arg) is
thin glue verified manually.
* fix: Stop replxx aborting when navigating multi-line buffers
mgconsole assembles multi-line queries itself via the continuation prompt and
does not use replxx's in-buffer multiline editing, which is buggy in the pinned
release-0.0.4. history_previous() calls prev_newline_position(_pos - 1) without
the `_pos > 0` guard its sibling history_next() has; with a newline at buffer
position 0 (navigating up through a recalled multi-line history entry) it passes
-1 and trips an assertion that aborts the process. Separately, in-buffer
multiline redraws clear to end of screen and erase already-printed output.
Patch replxx (replxx-patches/, applied via the replxx-proj PATCH_COMMAND) to add
the missing bounds guard to history_previous. This fixes the abort for any
newline-bearing buffer, including multi-line entries decoded from the history
file.
Rebind Ctrl-J (line feed, 0x0A) to commit_line so a bare newline submits the
current line like Enter instead of feeding replxx's NEW_LINE action. A multi-line
paste then submits one physical line at a time, which is what GetQuery expects,
and keeps pasted or typed newlines out of the buffer so the redraw corruption
stays unreachable for the common paste case. It does not cover newlines that
arrive from history, which is why the bounds guard is the actual crash fix.
0 commit comments