Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DB Connection String Builder Pro

CI License: MIT Vanilla JS

Build and parse MySQL, PostgreSQL, MongoDB, Redis, Elasticsearch and RabbitMQ connection strings with correct URI syntax, real SSL/TLS and pooling params, and safe URL-encoding — entirely offline.

A backend developer's connection-string cheat sheet made interactive. Fill in host, port, credentials and extra params to get a correct, properly-encoded URI for six drivers — or paste an existing string to instantly decompose it back into its parts. Nothing you type ever leaves your browser.

Overview

DB Connection String Builder Pro is part of the Web Utility Suite. It runs entirely client-side with no build step, no frameworks, and no network calls — open index.html from disk and it works. Switch between MySQL, PostgreSQL, MongoDB, Redis, Elasticsearch and RabbitMQ tabs, fill in the form, and get a live, correctly-formatted connection string with the password masked by default. Paste a real connection string into reverse mode and it detects the driver and repopulates every field — including the SSL/TLS toggle and pooling params.

Features

  • Six drivers, real URI formats: mysql://, postgresql:// (with the postgres:// alias), mongodb:// (with mongodb+srv:// DNS-seedlist mode and multi-host replica sets), redis:// (with rediss:// for TLS), http(s):// for Elasticsearch, and amqp(s):// for RabbitMQ — each with its correct, IANA/vendor-documented default port.
  • SSL/TLS toggle per driver, with the correct mechanism — a query param where that's how the driver signals it (MySQL ?ssl-mode=REQUIRED, PostgreSQL ?sslmode=require, MongoDB ?tls=true), or a scheme swap where that's how it's really done (Redis rediss://, Elasticsearch https://, RabbitMQ amqps:// — which also flips the default port from 5672 to the IANA-registered 5671).
    postgresql://app_user:s3cr3t@db.example.com:5432/my_app?sslmode=require
    
  • MongoDB replica sets — a "Replica set (multiple hosts)" toggle builds the real comma-separated host1:port1,host2:port2,host3:port3 authority plus ?replicaSet=name, mutually exclusive with mongodb+srv:// (SRV already encodes a seed list via DNS):
    mongodb://app_user:s3cr3t@h1:27017,h2:27017,h3:27017/my_app?replicaSet=rs0
    
  • Connection pooling params, only where the driver actually supports them via the URI — MySQL/mysql2 (connectionLimit, queueLimit, waitForConnections), PostgreSQL (libpq's real connect_timeout plus Prisma's documented connection_limit/pool_timeout convention, labeled honestly as such), MongoDB (maxPoolSize, minPoolSize, serverSelectionTimeoutMS), and RabbitMQ (heartbeat, connection_timeout). Redis and Elasticsearch clients don't pool via the URI, so no fake params are offered there.
    mysql://app_user:s3cr3t@db.example.com:3306/my_app?connectionLimit=10&queueLimit=0&waitForConnections=true
    
  • Elasticsearch (new) — the real http(s)://user:pass@host:9200 node-URL shape used by the official clients, with no fabricated database/index path.
  • RabbitMQ / AMQP (new) — the real amqp://user:pass@host:5672/vhost shape from RabbitMQ's own URI spec; the default vhost / is correctly percent-encoded as %2F when present (encodeURIComponent handles this generically, the same way every other field is encoded):
    amqps://guest:guest@rabbit.example.com:5671/%2F?heartbeat=60
    
  • Redis with a real password/DB-index formredis://:password@host:port/0 (no username, leading : — the documented pre-ACL/password-only form) alongside the standard username:password ACL form, plus rediss:// for TLS.
  • Correct URL-encoding — usernames, passwords and virtual-host/vhost names are run through encodeURIComponent (which also correctly escapes / to %2F), while the structural : and @ separators are left untouched.
  • JDBC form for MySQL — optionally emits the jdbc:mysql://host:port/db?user=...&password=... form used by Java database drivers.
  • Reverse mode — paste any supported connection string (including jdbc:mysql://… and multi-host MongoDB replica sets) and it parses host, port, database, username, password, SSL/TLS state, pool params and extra query parameters back into the form, auto-detecting the driver and any scheme variant (postgres, mongodb+srv, rediss, https, amqps). See TESTS.md for traced round-trip examples covering every driver.
  • Password masking — the generated string masks the password by default; a reveal toggle shows it, and Copy always copies the real, unmasked value.
  • Extra parameters — a simple key=value-per-line box becomes a properly-encoded query string; it never collides with the structured SSL/pool params (the structured value always wins over a manually-typed duplicate key).
  • Privacy-first persistence — non-sensitive fields (including SSL/pool toggles and values) are restored on your next visit via localStorage; passwords are never persisted.
  • Dark & light themes, fully responsive down to 360px, accessible, and keyboard-driven.
  • 100% client-side — there are no network calls anywhere in this tool. Safe to use with real credentials on your own machine.

Installation

No dependencies, no build step.

git clone https://github.com/kasapdev/db-connection-string-builder-pro.git
cd db-connection-string-builder-pro

Then simply open index.html in any modern browser (double-click it, or file:// it). That's it.

Usage

  1. Pick a driver tab: MySQL, PostgreSQL, MongoDB, Redis, Elasticsearch, or RabbitMQ.
  2. Fill in host, port, database (DB index for Redis, virtual host for RabbitMQ, none for Elasticsearch), username, password, and any extra parameters.
  3. Toggle driver-specific options as needed — JDBC form for MySQL, the postgres:// alias, mongodb+srv:// or a replica set for MongoDB, SSL/TLS, and pooling/connection-tuning params where the driver supports them.
  4. Copy the generated connection string with the Copy connection string button — it always copies the real, unmasked value.
  5. To reverse-engineer an existing string, paste it into the Reverse mode field and click Parse (or press Ctrl/⌘+Enter while focused there).

Keyboard Shortcuts

Action Shortcut
Parse pasted string (reverse field) Ctrl/⌘ + Enter
Show shortcuts help ?
Close dialog Esc

Screenshots

Screenshots coming soon.

Roadmap

  • Multi-host support for MongoDB replica set strings
  • SQLite / SQL Server / Oracle connection string formats
  • .env file export (DB_HOST=, DB_PORT=, …) alongside the URI
  • Connection string strength/sanity linting (missing password, default ports, etc.)

License

MIT Licensed. Part of the Web Utility Suite.


Part of the kasapdev Tools Suite

One of 45+ zero-dependency vanilla JS tools, all free and open source — see the full list.

About

Build and parse MySQL, PostgreSQL, MongoDB and Redis connection strings/URIs with proper URL-encoding, in both directions. 100% client-side, nothing sent anywhere.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages