sqlitetest

package
v0.0.0-...-eb0b6c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 10 Imported by: 0

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

func WithMigrationFunc(fn func(context.Context, *stdsql.DB) error) NewHelperOption

WithMigrationFunc sets a custom migration function to run instead of the built-in one.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL