Type-safe Database Client for Go. Supports PostgreSQL and SQLite.
The code is stable and has been in production for many years now including Standup Jack.
# connect to a postgres database and build the client in pogo/
pogo --db $(POSTGRES_URL) --schema public --dir ./pogo
pgconfig, err := pgx.ParseURI(env.DatabaseURL)
if err != nil {
return err
}
db, err := pgx.Connect(pgconfig)
if err != nil {
return err
}
users, err := user.FindMany(db,
user.NewFilter().Email("alice@livebud.com"),
user.NewOrder().CreatedAt(user.DESC),
)
Check out the tests for more usage examples.
To run the tests, you'll need to have PostgreSQL installed locally with an empty pogo
database:
createdb pogo
make test
MIT