Skip to content

Conversation

@sgaunet
Copy link
Owner

@sgaunet sgaunet commented Dec 7, 2025

  • Add Connect() method accepting connection string as parameter
  • Implement connect_database MCP tool with parameter validation
  • Support both full URL and individual connection parameters
  • Add buildConnectionString() helper with defaults (port=5432, sslmode=prefer)
  • Refactor tryConnect() to delegate to Connect() method
  • Remove auto-connect from New() constructor for explicit control
  • Update error messages to guide users to connect_database tool
  • Maintain backward compatibility with environment variables as fallback
  • Update all integration tests to use explicit Connect() calls
  • Add comprehensive unit tests for connection builder and Connect() method

Implements #36

- Add Connect() method accepting connection string as parameter
- Implement connect_database MCP tool with parameter validation
- Support both full URL and individual connection parameters
- Add buildConnectionString() helper with defaults (port=5432, sslmode=prefer)
- Refactor tryConnect() to delegate to Connect() method
- Remove auto-connect from New() constructor for explicit control
- Update error messages to guide users to connect_database tool
- Maintain backward compatibility with environment variables as fallback
- Update all integration tests to use explicit Connect() calls
- Add comprehensive unit tests for connection builder and Connect() method

Implements #36
@sgaunet sgaunet linked an issue Dec 7, 2025 that may be closed by this pull request
8 tasks
@sgaunet sgaunet self-assigned this Dec 7, 2025
@sgaunet sgaunet added the feature New feature label Dec 7, 2025
@sgaunet sgaunet merged commit a88eeb3 into main Dec 7, 2025
4 of 5 checks passed
@sgaunet sgaunet deleted the 36-pass-connection-string-as-parameter-instead-of-reading-from-environment branch December 7, 2025 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pass connection string as parameter instead of reading from environment

2 participants