Skip to content

feat: slash command for changing connection#27

Open
andylokandy wants to merge 4 commits intoscopedb:mainfrom
andylokandy:dev
Open

feat: slash command for changing connection#27
andylokandy wants to merge 4 commits intoscopedb:mainfrom
andylokandy:dev

Conversation

@andylokandy
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ReplState to hold REPL runtime state (client, prompt, format, timer, connection name).
  • Add /connection NAME subcommand 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.

Comment thread scopeql/src/repl/entrypoint.rs Outdated
Comment thread scopeql/src/repl/command.rs Outdated
Comment thread scopeql/src/repl/entrypoint.rs
Comment thread scopeql/src/repl/entrypoint.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants