hooks

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor struct {
	sqlt.Executor

	Before func(string, ...any) (string, []any, error)
	After  func(sql.Result, error, time.Duration, string, ...any) (sql.Result, error)
}

Executor is a hook container over sqlt.Executor capable to run before and after functions to modify or log data.

func (Executor) Exec

func (e Executor) Exec(query string, args ...any) (sql.Result, error)

Exec is sqlt.Executor interface implementation

type Getter

type Getter struct {
	sqlt.Getter

	Before func(any, string, ...any) (any, string, []any, error)
	After  func(error, time.Duration, any, string, ...any) error
}

Getter is a hook container over sqlt.Getter capable to run before and after functions to modify or log data.

func (Getter) Get

func (g Getter) Get(dest any, query string, args ...any) error

Get is sqlt.Getter interface implementation

type Querier

type Querier struct {
	sqlt.Querier

	Before func(string, ...any) (string, []any, error)
	After  func(*sql.Rows, error, time.Duration, string, ...any) (*sql.Rows, error)
}

Querier is a hook container over sqlt.Querier capable to run before and after functions to modify or log data.

func (Querier) Query

func (q Querier) Query(query string, args ...any) (*sql.Rows, error)

Query is sqlt.Querier interface implementation

type Reader

type Reader struct {
	Getter
	Selector
}

Reader is a hook container over sqlt.Reader capable to run before and after functions to modify or log data.

func (Reader) Get

func (r Reader) Get(dest any, query string, args ...any) error

Get is sqlt.Getter and sqlt.Reader interfaces implementation

func (Reader) Select

func (r Reader) Select(dest any, query string, args ...any) error

Select is sqlt.Selector and sqlt.Reader interfaces implementation

type ReaderExecutor

type ReaderExecutor struct {
	Getter
	Selector
	Executor
}

ReaderExecutor is a hook container over sqlt.ReaderExecutor capable to run before and after functions to modify or log data.

func (ReaderExecutor) Exec

func (r ReaderExecutor) Exec(query string, args ...any) (sql.Result, error)

Exec is sqlt.Executor and sqlt.ReaderExecutor interfaces implementation

func (ReaderExecutor) Get

func (r ReaderExecutor) Get(dest any, query string, args ...any) error

Get is sqlt.Getter and sqlt.ReaderExecutor interfaces implementation

func (ReaderExecutor) Select

func (r ReaderExecutor) Select(dest any, query string, args ...any) error

Select is sqlt.Selector and sqlt.ReaderExecutor interfaces implementation

type Selector

type Selector struct {
	sqlt.Selector

	Before func(any, string, ...any) (any, string, []any, error)
	After  func(error, time.Duration, any, string, ...any) error
}

Selector is a hook container over sqlt.Selector capable to run before and after functions to modify or log data.

func (Selector) Select

func (s Selector) Select(dest any, query string, args ...any) error

Select is sqlt.Selector interface implementation

Jump to

Keyboard shortcuts

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