A data source name adapter for sql.Open in golang.
name, dsn, _ := dsn.FromRailsConfig("myapp/config/database.yml", "production")
fmt.Printf("[%s] %s", name, dsn)
// => [mysql] username:password@tcp(localhost:3306)/dbname
- Data Source Name from Rails database.yml.
- Support MySQL, PostgreSql, Sqlite.
$ go get github.com/monochromegane/dsn
- Data Source Name from flags.
- Data Source Name from Env.
- Fork it
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
go test ./...
command and confirm that it passes - Run
gofmt -s
- Create new Pull Request