sgaunet / dsn

golang library to handle data source name : scheme://user:password@host:port/dbname&sslmode=disable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go Report Card Maintainability Test Coverage

dsn

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

Install

Option 1

  • Download the release
  • Install the binary in /usr/local/bin

Option 2: With brew

brew tap sgaunet/tools
brew install dsn

Option 3: Docker image

Possibility to copy the binary by using the docker image

FROM sgaunet/dsn:latest as builder

FROM ....
COPY --from builder /dsn /usr/bin/dsn

Development

This project is using :

The docker image is only created to simplify the copy of dsn in another docker image.

About

golang library to handle data source name : scheme://user:password@host:port/dbname&sslmode=disable

License:MIT License


Languages

Language:Go 99.9%Language:Dockerfile 0.1%