mirror of
https://github.com/executeautomation/mcp-database-server.git
synced 2025-12-09 21:12:57 +08:00
Add connection timeout support for PostgreSQL in MCP Database Server
Enhanced the PostgreSQL connection handling by introducing a `--connection-timeout` parameter, allowing users to specify a custom timeout in milliseconds. Updated relevant documentation in README and postgresql-setup.md to reflect this new option. Modified the PostgresqlAdapter to utilize the connection timeout setting during database connections.
This commit is contained in:
@@ -92,7 +92,8 @@ else if (args.includes('--postgresql') || args.includes('--postgres')) {
|
||||
user: undefined,
|
||||
password: undefined,
|
||||
port: undefined,
|
||||
ssl: undefined
|
||||
ssl: undefined,
|
||||
connectionTimeout: undefined
|
||||
};
|
||||
|
||||
// Parse PostgreSQL connection parameters
|
||||
@@ -109,6 +110,8 @@ else if (args.includes('--postgresql') || args.includes('--postgres')) {
|
||||
connectionInfo.port = parseInt(args[i + 1], 10);
|
||||
} else if (args[i] === '--ssl' && i + 1 < args.length) {
|
||||
connectionInfo.ssl = args[i + 1] === 'true';
|
||||
} else if (args[i] === '--connection-timeout' && i + 1 < args.length) {
|
||||
connectionInfo.connectionTimeout = parseInt(args[i + 1], 10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user