https://github.com/ericfrancis12/db-conn
Test database connections in bulk.
https://github.com/ericfrancis12/db-conn
database-connection database-driver database-utilities
Last synced: 6 months ago
JSON representation
Test database connections in bulk.
- Host: GitHub
- URL: https://github.com/ericfrancis12/db-conn
- Owner: EricFrancis12
- License: mit
- Created: 2025-06-01T21:59:43.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-06-15T02:27:48.000Z (8 months ago)
- Last Synced: 2025-06-15T03:30:54.735Z (8 months ago)
- Topics: database-connection, database-driver, database-utilities
- Language: Go
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DB Conn
A Go utility to test database connection strings in parallel, with configurable driver and input file.
## Features
- 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
## Usage
```bash
make run ARGS="[flags]"
```
## Example Usage
```bash
make run ARGS="-f my_targets.txt -d mysql -t 2s"
```
## Supported Drivers (-d flag)
- postgres (default)
- mysql
- sqlite3
## AWS Lambda Deployment
You can deploy this utility as an AWS Lambda function. Follow these steps:
### 1. Create a targets.txt file
Create a file called `targets.txt` at the project root, and list your connection strings on it (one per line).
### 2. Build the Lambda Binary
Build a Linux executable named `bootstrap` (required name for Lambda custom runtime):
```bash
make build_lambda
```
This will:
- Build the binary for Linux (`GOOS=linux`)
- Output it as `bootstrap`
- Zip it as `db-conn.zip`
### 3. Upload to AWS Lambda
1. Go to the AWS Lambda console.
2. Create a new Lambda function (see image below).
3. Upload the `db-conn.zip` file as the function code.