Skip to content

Add developer Run SQL subcommand and service to execute arbitrary SQL#4475

Merged
wholton merged 2 commits intomasterfrom
codex/add-developer-command-for-sql-execution
Feb 27, 2026
Merged

Add developer Run SQL subcommand and service to execute arbitrary SQL#4475
wholton merged 2 commits intomasterfrom
codex/add-developer-command-for-sql-execution

Conversation

@wholton
Copy link
Collaborator

@wholton wholton commented Feb 26, 2026

No description provided.

Copy link
Contributor

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 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 RunSqlService with SQL execution, result formatting, and response truncation safeguards
  • Added RunSql command that invokes the service and posts results to a timestamped thread
  • Registered RunSql in DeveloperCommand'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.

Copy link
Contributor

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

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.
@wholton wholton merged commit 12081a3 into master Feb 27, 2026
2 checks passed
@wholton wholton deleted the codex/add-developer-command-for-sql-execution branch February 27, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants