buntest

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DB

func DB(t *testing.T) *bun.DB

func DSN

func DSN() string

func Init

func Init(opts ...Options) func() error

func NewBun

func NewBun(dsn string) *bun.DB

func Tx

func Tx(t *testing.T) *bun.DB

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(t *testing.T, opts ...Options) *Client

func (*Client) DB

func (c *Client) DB(t *testing.T) *bun.DB

DB returns a new connection to the database. By default, returns the pool.

func (*Client) DSN

func (c *Client) DSN() string

func (*Client) Tx

func (c *Client) Tx(t *testing.T) *bun.DB

type Options

type Options struct {
	Driver   string
	Duration time.Duration
	Hook     func(dsn string) error
	Image    string
}

func NewOptions

func NewOptions() *Options

func (*Options) Merge

func (o *Options) Merge(opts ...Options) *Options

Jump to

Keyboard shortcuts

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