PostgreSQL Connection String Builder
Generate, parse, and convert PostgreSQL connection strings instantly. Everything runs in your browser — nothing is uploaded.
Why Use This Tool?
- Save Time: Generate correct PostgreSQL connection strings without memorizing URL syntax
- Multi-Format Output: Get your connection string as URI, JDBC, Spring Boot, Prisma, .env, Docker Compose, Kubernetes Secret, psql CLI, Sequelize, TypeORM, Drizzle, Django, SQLAlchemy, and ADO.NET
- Parse Existing Strings: Paste any existing PostgreSQL URI or JDBC URL to auto-populate fields
- SSL Configuration: Full support for all 6 PostgreSQL SSL modes (disable through verify-full)
- Security-Aware: Built-in analysis flags hardcoded passwords, missing SSL, and other risks
PostgreSQL Connection String Format
postgresql://user:password@host:5432/dbname?sslmode=prefer&connect_timeout=10
Components
| Component |
Description |
Required |
user |
Database username |
Yes |
password |
User's password (URL-encode special chars) |
Yes |
host |
Server hostname or IP |
Yes |
5432 |
Port (default: 5432) |
No |
dbname |
Database name |
Yes |
sslmode |
SSL mode (disable, allow, prefer, require, verify-ca, verify-full) |
No |
connect_timeout |
Connection timeout in seconds |
No |
Output Formats
URI (Standard)
postgresql://admin:password@prod-server-1:5432/mydb?sslmode=verify-full
JDBC
jdbc:postgresql://prod-server-1:5432/mydb?user=admin&password=password&sslmode=verify-full
Spring Boot (application.properties)
spring.datasource.url=jdbc:postgresql://prod-server-1:5432/mydb?sslmode=verify-full
spring.datasource.username=admin
spring.datasource.password=password
spring.datasource.driver-class-name=org.postgresql.Driver
Prisma (.env + schema.prisma)
DATABASE_URL="postgresql://admin:password@prod-server-1:5432/mydb?sslmode=verify-full"
Docker Compose
services:
postgres:
image: postgres:16
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
POSTGRES_DB: mydb
ports:
- "5432:5432"
Kubernetes Secret
apiVersion: v1
kind: Secret
metadata:
name: postgres-secret
type: Opaque
stringData:
database-url: postgresql://admin:password@postgres-service:5432/mydb?sslmode=verify-full
psql CLI
psql "postgresql://admin:password@prod-server-1:5432/mydb?sslmode=verify-full"
SSL Modes Reference
| Mode |
Security |
Use Case |
| disable |
None |
Local development only |
| allow |
Low |
Fallback scenarios |
| prefer |
Low |
Development with optional SSL |
| require |
Medium |
Encrypted connection, no cert validation |
| verify-ca |
High |
Encrypted + CA verification |
| verify-full |
Highest |
Production: encrypted + CA + hostname verification |
How to Use
- Enter your fields — Fill in host, port, credentials, and database name
- Configure SSL — Select the appropriate SSL mode for your environment
- Add advanced params — Pool size, timeouts, SSL cert paths as needed
- Copy or download — Switch between any of the 20+ output formats
- Parse existing strings — Paste a connection string to auto-populate all fields