testdb

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestFeed added in v0.8.0

func CreateTestFeed(atx tldb.Adapter, url string) dmfr.Feed

CreateTestFeed returns a simple feed inserted into a database.

func MustFind

func MustFind(atx tldb.Adapter, ent interface{})

MustFind panics on failure

func MustGet

func MustGet(atx tldb.Adapter, ent interface{}, qstr string, qargs ...interface{})

MustGet panics on failure

func MustInsert

func MustInsert(atx tldb.Adapter, ent interface{}) int

MustInsert panics on failure

func MustOpenWriter added in v0.10.0

func MustOpenWriter(dburl string, create bool) *tldb.Writer

func MustSelect

func MustSelect(atx tldb.Adapter, ent interface{}, qstr string, qargs ...interface{})

MustSelect panics on failure

func MustUpdate

func MustUpdate(atx tldb.Adapter, ent interface{}, columns ...string)

MustUpdate panics on failure

func ShouldFind

func ShouldFind(t *testing.T, atx tldb.Adapter, ent interface{})

ShouldFind sends a test error on failure

func ShouldGet

func ShouldGet(t *testing.T, atx tldb.Adapter, ent interface{}, qstr string, qargs ...interface{})

ShouldGet sends a test error on failure

func ShouldInsert

func ShouldInsert(t *testing.T, atx tldb.Adapter, ent interface{}) int

ShouldInsert sends a test error on failure

func ShouldSelect

func ShouldSelect(t *testing.T, atx tldb.Adapter, ent interface{}, qstr string, qargs ...interface{})

ShouldSelect sends a test error on failure

func ShouldUpdate

func ShouldUpdate(t *testing.T, atx tldb.Adapter, ent interface{}, columns ...string)

ShouldUpdate sends a test error on failure

func TempPostgres added in v0.18.0

func TempPostgres(dburl string, cb func(tldb.Adapter) error) error

func TempSqlite added in v0.11.0

func TempSqlite(cb func(tldb.Adapter) error) error

TempSqlite creates a temporary in-memory database and runs the callback inside a tx.

func TempSqliteAdapter added in v0.13.0

func TempSqliteAdapter() tldb.Adapter

Types

type AdapterIgnoreTx

type AdapterIgnoreTx struct {
	tldb.Adapter
}

AdapterIgnoreTx .

func (*AdapterIgnoreTx) Tx

func (atx *AdapterIgnoreTx) Tx(cb func(tldb.Adapter) error) error

Tx runs in same tx if tx already open, otherwise runs without tx

Jump to

Keyboard shortcuts

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