dbutils

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	DB *sql.DB
	// contains filtered or unexported fields
}

func New

func New(t *testing.T, db *sql.DB) *Database

func (*Database) CreateSchema

func (db *Database) CreateSchema(t *testing.T, schema string, opts ...OptionContext)

func (*Database) DropSchema

func (db *Database) DropSchema(t *testing.T, schema string, opts ...OptionContext)

func (*Database) ExecuteFiles

func (db *Database) ExecuteFiles(t *testing.T, files []string, opts ...OptionExec)

func (*Database) ExecuteFolder

func (db *Database) ExecuteFolder(t *testing.T, folder string, opts ...OptionExec)

func (*Database) NameGen

func (db *Database) NameGen(prefix string) string

func (*Database) SetSchema

func (db *Database) SetSchema(t *testing.T, schema string, opts ...OptionContext)

type OptionContext

type OptionContext func(o *optionContext)

func WithContext

func WithContext(ctx context.Context) OptionContext

WithContext sets the context for the main function.

type OptionExec

type OptionExec func(o *optionExec)

func WithExecContext

func WithExecContext(ctx context.Context) OptionExec

WithContext sets the context for the file execution.

func WithTimeout

func WithTimeout(timeout time.Duration) OptionExec

WithTimeout sets the timeout for each file execution.

func WithValues

func WithValues(values map[string]string) OptionExec

WithValues sets os.Expand values inside the file content.

Jump to

Keyboard shortcuts

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