testutils

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSchema

func GetSchema() string

GetSchema returns the canonical database schema

func InitTestDB

func InitTestDB(tb testing.TB, sqlDB *sql.DB) error

InitTestDB initializes a test database with the canonical schema

func InitTestDBNoFTS

func InitTestDBNoFTS(sqlDB *sql.DB) error

InitTestDBNoFTS initializes a test database with the schema minus FTS5 features

func InitTestDBWithDB

func InitTestDBWithDB(tb testing.TB, sqlDB *sql.DB) error

InitTestDBWithDB initializes a test database with the canonical schema using provided DB connection

func StripFTSFromSchema

func StripFTSFromSchema(schema string) string

StripFTSFromSchema returns the schema without FTS5-specific statements

Types

type TestFixture

type TestFixture struct {
	T       *testing.T
	DBPath  string
	TempDir string
}

func Setup

func Setup(t *testing.T) *TestFixture

func (*TestFixture) Cleanup

func (f *TestFixture) Cleanup()

func (*TestFixture) CreateDummyFile

func (f *TestFixture) CreateDummyFile(name string) string

func (*TestFixture) CreateFileTree

func (f *TestFixture) CreateFileTree(tree map[string]any)

func (*TestFixture) GetDB

func (f *TestFixture) GetDB() *sql.DB

Jump to

Keyboard shortcuts

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