An opinionated small PostgreSQL client library based on jmoiron/sqlx
A postgres client with support for enforcing transactions and allowing the user to utilize transactions with the same interface as when not in a transaction.
ConnectFromEnv assumes environment variables:
DB_USER
DB_PASS
DB_HOST
DB_PORT
DB_DATABASEto exist.
package main
import (
"github.com/frederikhs/go-connection"
)
type City struct {
Name string
County string
}
func main() {
conn := connection.ConnectFromEnv()
var cities []City
err := conn.Select(&cities, "SELECT name, country FROM cities WHERE country = $1", "Denmark")
if err != nil {
panic(err)
}
...
}release a new version by creating a tag and pushing it
git tag -a v0.x.0 -m "v0.x.0"
git push origin v0.x.0