Connect CockroachDB
Detailed guide for connecting CockroachDB to Data Explorer, including SSL configuration, Docker setup, and common troubleshooting.
CockroachDB
26257
postgresql://
Pooled Adapter
How to Connect
Method 1: Connection URI
# General format
postgresql://root@localhost:26257/defaultdb?sslmode=require
Method 2: Connection Form
HostlocalhostIP address or hostname of the database serverPort26257Default port: 26257UsernamerootLogin user with database accessPassword••••••Password (AES-256 encrypted before storage)DatabasemydbDatabase name you want to exploreConnection Guardrails
SSH Tunneling (Secure)
- Supports authentication via password or Private Key (OpenSSH format).
- Automatic destination IP validation (SSRF Protection).
- Periodic tunnel health checks to maintain connectivity.
Supported Features
- PostgreSQL wire-protocol compatibility
- Dedicated strategy with the 26257 default port
- Metrics via crdb_internal tables
- Graceful degradation when crdb_internal is unavailable
- Schema and view browsing via information_schema
- CRUD and transactional query support
Internal Introspection Query
# Table structure analysis query
SELECT table_name, column_name, data_type, is_nullable
FROM information_schema.columns
WHERE table_schema = 'public'
ORDER BY table_name, ordinal_position;
Docker Quick Start
# Start CockroachDB container
docker run -d \
--name data-explorer-cockroach \
start-single-node --insecure \
-p 26257:26257 \
cockroachdb/cockroach:latest-v24.3
Advanced Tuning
Connection Pooling
By default, the system maintains a connection pool to optimize response speed. For databases with limited sessions (like Supabase Free Tier), consider reducing the timeout to free up connections faster.
SSL/TLS Handshake
The system supports SSL Modes "prefer" and "require". For connections requiring custom CA certificates, you need to mount the certificate file into the /certs directory of the backend server.
Security Note
CockroachDB clusters usually require TLS. Use the connection string from the cluster dashboard, or start a local insecure single-node container for development.
Ready to explore data?
Join the community on GitHub to contribute to the smartest local database IDE.
Launch App