Tiny library to handle data source name : scheme://user:password@host:port/dbname&sslmode=disable
It's really dumb but useful for me at least.
And now it's a binary that can be used in bash script.
$ eval $(dsn setenv --d "pg://login:password@host/mydb?timeout=1000" --pr DB_)
$ echo $DB_HOST
host
- Download the release
- Install the binary in /usr/local/bin
brew tap sgaunet/homebrew-tools
brew install sgaunet/tools/dsn
Possibility to copy the binary by using the docker image
FROM sgaunet/dsn:latest as builder
FROM ....
COPY --from builder /dsn /usr/bin/dsn
This project is using :
- golang 1.19+
- task for development
- docker
- docker buildx
- docker manifest
- goreleaser
The docker image is only created to simplify the copy of dsn in another docker image.