A Go utility to test database connection strings in parallel, with configurable driver and input file.
- Reads a list of database connection strings from a file, one per line (see
targets.example.txt). - Connects to each database in parallel using the specified driver
- Reports success/failure for each connection and overall success rate
make run ARGS="[flags]"make run ARGS="-f my_targets.txt -d mysql -t 2s"- postgres (default)
- mysql
- sqlite3
You can deploy this utility as an AWS Lambda function. Follow these steps:
Create a file called targets.txt at the project root, and list your connection strings on it (one per line).
Build a Linux executable named bootstrap (required name for Lambda custom runtime):
make build_lambdaThis will:
- Build the binary for Linux (
GOOS=linux) - Output it as
bootstrap - Zip it as
db-conn.zip
- Go to the AWS Lambda console.
- Create a new Lambda function (see image below).
- Upload the
db-conn.zipfile as the function code.