Skip to content

feat: add startup commands for connections#212

Merged
datlechin merged 2 commits intomainfrom
feat/startup-commands
Mar 9, 2026
Merged

feat: add startup commands for connections#212
datlechin merged 2 commits intomainfrom
feat/startup-commands

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • Add a "Startup Commands" text field in Connection > Advanced tab for running custom SQL after connecting (e.g., SET time_zone, SET search_path, SET NAMES)
  • Commands execute automatically on initial connect, manual reconnect, and auto-reconnect — on both main and metadata drivers
  • Fix duplicateConnection() to copy all fields (was missing sslConfig, isReadOnly, aiPolicy, and DB-specific settings)

Test plan

  • Create a new connection with startup commands (e.g., SET time_zone = 'Asia/Ho_Chi_Minh'), connect, verify with SELECT @@time_zone
  • Edit an existing connection to add startup commands, disconnect/reconnect, verify commands execute
  • Duplicate a connection with startup commands, verify they are copied
  • Test with multiple commands separated by semicolons and newlines
  • Test with invalid command — verify connection still succeeds (warning logged)
  • Upgrade from old config (no startupCommands field) — verify no crash
  • Verify quotes stay straight in the editor (no smart quote substitution)

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin datlechin merged commit 1df506e into main Mar 9, 2026
2 checks passed
@datlechin datlechin deleted the feat/startup-commands branch March 9, 2026 02:27
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.

1 participant