feat: slash command for changing connection#27
Open
andylokandy wants to merge 4 commits intoscopedb:mainfrom
Open
feat: slash command for changing connection#27andylokandy wants to merge 4 commits intoscopedb:mainfrom
andylokandy wants to merge 4 commits intoscopedb:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds the ability to switch REPL connection profiles via a new slash command, and refactors REPL runtime state to make the active connection and prompt mutable during a session.
Changes:
- Introduce
ReplStateto hold REPL runtime state (client, prompt, format, timer, connection name). - Add
/connection NAMEsubcommand to switch the active connection profile and update the prompt. - Add a reedline Ctrl-C/Ctrl-D workaround to decide whether to clear the line or exit based on buffer contents.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scopeql/src/repl/prompt.rs | Adds an accessor for the prompt’s current endpoint so it can be shown after switching. |
| scopeql/src/repl/entrypoint.rs | Refactors REPL to use ReplState, adds connection switching, and updates Ctrl-C/Ctrl-D behavior via host commands. |
| scopeql/src/repl/command.rs | Adds /connection subcommand and adjusts subcommand ordering/help definitions. |
| scopeql/src/config.rs | Renames connection type and adds helpers for default connection name and enumerating profiles. |
| scopeql/src/client/mod.rs | Updates client construction to accept the renamed connection config type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.