asqltest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const TestDSN = "postgres://test:test@localhost:5432/test?sslmode=disable"

Variables

This section is empty.

Functions

func BeginTestTX

func BeginTestTX[T any](database bun.IDB, fixtures []T) bun.Tx

func ClearTestDB

func ClearTestDB(database *bun.DB)

func FreezeTime

func FreezeTime(db bun.IDB, date time.Time) error

func OpenTestDB

func OpenTestDB(sqlMigrations *embed.FS) (*bun.DB, func(), error)

OpenTestDB opens a connection to a test DB.

The test DB must be available under the value stored in DSN.

func RestoreTime

func RestoreTime(db bun.IDB) error

func RollbackTestTX

func RollbackTestTX(transaction bun.Tx)

Types

This section is empty.

Jump to

Keyboard shortcuts

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