POST
/api/test-connection

Connection Tester API

Verify database credentials, test network reachability, calculate roundtrip connection latency, and receive intelligent port mismatch suggestions.

Request Body

json
{
  "type": "postgres",
  "host": "postgres.internal.cloud",
  "port": 5432,
  "user": "db_user",
  "password": "my_password",
  "database": "production",
  "ssl": true
}

Dialect Specifics

postgres / mysql / mssql / oracle: Requires host, user, database, and optional port / ssl.
sqlite: Requires filePath pointing to a valid accessible database file.

Intelligent Port Mismatch Hints

If an engineer accidentally selects mysql as the provider but specifies port 5432, the endpoint detects the mismatch and returns a corrective suggestion before attempting connection timeouts:

"Port 5432 is the PostgreSQL default port. Did you mean to select the PostgreSQL provider?"

Success Response

json
{
  "success": true,
  "message": "Connection successful! (Latency: 18ms)"
}