Add developer Run SQL subcommand and service to execute arbitrary SQL#4475
Merged
Add developer Run SQL subcommand and service to execute arbitrary SQL#4475
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a developer-only SQL execution tool to enable direct database queries and operations for debugging and maintenance purposes. The feature is protected by role-based authorization at the parent command level and includes safeguards against excessive output.
Changes:
- Added
RunSqlServicewith SQL execution, result formatting, and response truncation safeguards - Added
RunSqlcommand that invokes the service and posts results to a timestamped thread - Registered
RunSqlinDeveloperCommand's subcommand map
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/main/java/ti4/spring/service/developer/RunSqlService.java |
Service that executes arbitrary SQL with MAX_ROWS, MAX_SQL_LENGTH, and MAX_RESPONSE_LENGTH safeguards |
src/main/java/ti4/commands/developer/RunSql.java |
Command handler that accepts SQL input and posts formatted results to a thread |
src/main/java/ti4/commands/developer/DeveloperCommand.java |
Registers the new RunSql subcommand alongside existing developer commands |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Refactor matchmaking statistics classes into the ti4.spring.service.statistics.matchmaking package. Renamed/relocated MatchmakingPlayer, MatchmakingRating, TrueSkillMatchmakingRatingService and related test to the new package. Removed the old MatchmakingGame and added a new MatchmakingGame under the spring package that builds MatchmakingGame list from PlayerEntity via getMatchmakingGames. Updated MatchmakingRatingEventService to call MatchmakingGame.getMatchmakingGames and removed duplicated game/players aggregation logic. Also updated imports in MatchmakingRatingCommand and tests to reflect the new package structure.
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.