Get Credentials
Get connection details for your database.
Endpoint
GET /v1/databases/{db_type}/{db_name}/credentials
Response
{
"db_name": "my_app_db",
"db_type": "postgresql",
"host": "172.29.1.10",
"port": 5432,
"username": "user_abc123",
"password": "securepassword123",
"connection_string": "postgresql://user_abc123:securepassword123@172.29.1.10:5432/my_app_db"
}
Connection Examples
Python (psycopg2)
import psycopg2
conn = psycopg2.connect(
host="172.29.1.10",
port=5432,
database="my_app_db",
user="user_abc123",
password="securepassword123"
)
cur = conn.cursor()
cur.execute("SELECT version();")
print(cur.fetchone())
Node.js (pg)
const { Client } = require('pg');
const client = new Client({
host: '172.29.1.10',
port: 5432,
database: 'my_app_db',
user: 'user_abc123',
password: 'securepassword123'
});
await client.connect();
const result = await client.query('SELECT NOW()');
console.log(result.rows[0]);