golazy.dev
–
golazy.dev
/
pg
/
withpg
Index
|
Files
|
Directories
package withpg ¶
import "golazy.dev/pg/withpg"
Functions ¶
func Test ¶
func Test(t *testing.T, cfg Config, fn func(*testing.T, DB))
func WithPg ¶
func WithPg(ctx context.Context, cfg Config, fn func(context.Context, *DB) error) error
Types ¶
type Config ¶
type Config struct {
SchemaFile string
PgVersion string
PgVersions []string
DataPath string
DBName string
Port uint32
Logger io.Writer
}
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func Start ¶
func Start(ctx context.Context, cfg Config) (*DB, error)
func (db DB) Client ¶
func (db DB) Client(ctx context.Context) (*pgx.Conn, error)
func (db DB) Close ¶
func (db DB) Close() error
func (db DB) URL ¶
func (db DB) URL() string
Directories ¶
| Path | Synopsis |
|---|---|
| pg/withpg/cmd/withpg |
Package withpg starts embedded PostgreSQL servers for local development and integration tests.