Skip to content

monochromegane/dsn

Repository files navigation

dsn Build Status

A data source name adapter for sql.Open in golang.

Usage

name, dsn, _ := dsn.FromRailsConfig("myapp/config/database.yml", "production")
fmt.Printf("[%s] %s", name, dsn)
// => [mysql] username:password@tcp(localhost:3306)/dbname

Features

  • Data Source Name from Rails database.yml.
  • Support MySQL, PostgreSql, Sqlite.

Installation

$ go get github.com/monochromegane/dsn

TODO

  • Data Source Name from flags.
  • Data Source Name from Env.

Contribution

  1. Fork it
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create new Pull Request

License

MIT

Author

monochromegane

About

A data source name adapter for sql.Open in golang.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages