testingutil

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress added in v0.4.0

func Compress() bool

Compress returns true if LTX compression is enabled.

func IsWALMode added in v0.3.0

func IsWALMode() bool

IsWALMode returns the true if -journal-mode is set to "wal".

func JournalMode added in v0.3.0

func JournalMode() string

JournalMode returns the value of -journal-mode.

func MustCopyDir

func MustCopyDir(tb testing.TB, src, dst string)

MustCopyDir recursively copies files from src directory to dst directory.

func OpenSQLDB

func OpenSQLDB(tb testing.TB, dsn string) *sql.DB

OpenSQLDB opens a connection to a SQLite database.

func PageSize added in v0.3.0

func PageSize() int

PageSize returns the value of -page-size flag

func ReopenSQLDB

func ReopenSQLDB(tb testing.TB, db **sql.DB, dsn string)

ReopenSQLDB closes the existing database connection and reopens it with the DSN.

func RetryUntil

func RetryUntil(tb testing.TB, interval, timeout time.Duration, fn func() error)

RetryUntil calls fn every interval until it returns nil or timeout elapses.

func WithTx added in v0.3.0

func WithTx(tb testing.TB, driverName, dsn string, fn func(tx *sql.Tx))

WithTx executes fn in the context of a database transaction. Transaction is committed automatically.

Types

This section is empty.

Jump to

Keyboard shortcuts

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