Documentation
¶
Overview ¶
Package dbtest provides utilities to use dockertest with PostgreSQL.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDB ¶
WithDB is like RunWithDB except it doesn't start a new sub-test.
func TestFunction(t *testing.T) { dbtest.WithDB(t, func(t) { // do stuff here }) }
func WithPool ¶
func WithPool(f func() int, opts ...DBConfigFn) int
WithPool makes sure we have a valid database pool. You should wrap your TestMain invocation with this.
func TestMain(m *testing.M) { os.Exit(withPool(m.Run)) }
Types ¶
type DBConfigFn ¶
type DBConfigFn func(c *dbCfg)
func WithImage ¶
func WithImage(img string) DBConfigFn
func WithInit ¶
func WithInit(b []byte) DBConfigFn
Click to show internal directories.
Click to hide internal directories.