sql

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound define error for empty rows result
	ErrNotFound = errors.New("DATA_NOT_FOUND")
	// ErrDataDuplicate define error for data duplication
	ErrDataDuplicate = errors.New("DATA_DUPLICATE")
)

Functions

This section is empty.

Types

type ISQL

type ISQL interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

ISQL is a interface for database/sql

type ISQLTX

type ISQLTX interface {
	Rollback() error
	Commit() error
}

ISQLTX is a interface for sql transaction

type Mock

type Mock struct{ mock.Mock }

Mock define testify/mock type

func (*Mock) Commit

func (m *Mock) Commit() error

Commit Mock

func (*Mock) Rollback

func (m *Mock) Rollback() error

Rollback Mock

type Queries

type Queries struct {
	DB ISQL
}

Queries ...

Jump to

Keyboard shortcuts

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