Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sgaunet/dsn
golang library to handle data source name : scheme://user:password@host:port/dbname&sslmode=disable
https://github.com/sgaunet/dsn
cli data-source-name dsn golang library
Last synced: 2 months ago
JSON representation
golang library to handle data source name : scheme://user:password@host:port/dbname&sslmode=disable
- Host: GitHub
- URL: https://github.com/sgaunet/dsn
- Owner: sgaunet
- License: mit
- Created: 2022-10-03T18:36:05.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-01T18:47:43.000Z (6 months ago)
- Last Synced: 2024-07-13T05:04:12.466Z (6 months ago)
- Topics: cli, data-source-name, dsn, golang, library
- Language: Go
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Go Report Card](https://goreportcard.com/badge/github.com/sgaunet/dsn)](https://goreportcard.com/report/github.com/sgaunet/dsn)
[![Maintainability](https://api.codeclimate.com/v1/badges/390713a97add700e028c/maintainability)](https://codeclimate.com/github/sgaunet/dsn/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/390713a97add700e028c/test_coverage)](https://codeclimate.com/github/sgaunet/dsn/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 builderFROM ....
COPY --from builder /dsn /usr/bin/dsn
```# Development
This project is using :
* golang 1.19+
* [task for development](https://taskfile.dev/#/)
* docker
* [docker buildx](https://github.com/docker/buildx)
* docker manifest
* [goreleaser](https://goreleaser.com/)The docker image is only created to simplify the copy of dsn in another docker image.