Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHelper ¶
func NewHelper(t *testing.T, opts ...NewHelperOption) *sql.Helper
NewHelper for testing, with optional options. Options: - WithFixtures to load fixtures after migration. - WithMigrationFunc to use a custom migration function instead of the built-in one.
Types ¶
type NewHelperOption ¶
type NewHelperOption func(*newHelperConfig)
NewHelperOption for NewHelper.
func WithFixtures ¶
func WithFixtures(fixtures ...string) NewHelperOption
WithFixtures adds SQL fixtures to be run after migrations. They are applied in the order given. Fixture names should not include the .sql extension. Fixtures are loaded from sqlite/testdata/fixtures/ directory from the project root.
func WithMigrationFunc ¶
WithMigrationFunc sets a custom migration function to run instead of the built-in one.
Click to show internal directories.
Click to hide internal directories.