repository

package
v0.0.0-...-041b7d9 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRowsAffected = errors.New("no row affected")

ErrNoRowsAffected ...

View Source
var ErrNoRowsFound = errors.New("no rows found")

ErrNoRowsFound ...

View Source
var ErrTxClosed = errors.New("transaction closed")

ErrTxClosed ...

View Source
var ErrTxCommitRollback = errors.New("transaction commit rollback")

ErrTxCommitRollback ...

Functions

This section is empty.

Types

type Connectionable

type Connectionable interface {
	QueryRow(ctx context.Context, sql string, args ...interface{}) Scanner
	Query(ctx context.Context, sql string, args ...interface{}) (MultiScanner, error)
	Exec(ctx context.Context, sql string, args ...interface{}) (int64, error)

	Begin(ctx context.Context) (Transactional, error)
}

Connectionable ...

type Executable

type Executable interface {
	Exec(ctx context.Context, sql string, args ...interface{}) (int64, error)
}

Executable ...

type MultiScanner

type MultiScanner interface {
	Scan(...interface{}) error
	Next() bool
	Close()
}

MultiScanner ...

type Queryable

type Queryable interface {
	Query(ctx context.Context, sql string, args ...interface{}) (MultiScanner, error)
}

Queryable ...

type QueryableRow

type QueryableRow interface {
	QueryRow(ctx context.Context, sql string, args ...interface{}) Scanner
}

QueryableRow ...

type Repository

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

Repository ...

func NewRepository

func NewRepository(pool *pgxpool.Pool) *Repository

NewRepository ...

func (*Repository) Begin

func (r *Repository) Begin(ctx context.Context) (Transactional, error)

Begin ...

func (*Repository) Exec

func (r *Repository) Exec(ctx context.Context, sql string, args ...interface{}) (int64, error)

Exec ...

func (*Repository) Query

func (r *Repository) Query(ctx context.Context, sql string, args ...interface{}) (MultiScanner, error)

Query ...

func (*Repository) QueryRow

func (r *Repository) QueryRow(ctx context.Context, sql string, args ...interface{}) Scanner

QueryRow ...

type Row

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

func (*Row) Scan

func (s *Row) Scan(src ...interface{}) error

type Rows

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

func (*Rows) Close

func (s *Rows) Close()

func (*Rows) Next

func (s *Rows) Next() bool

func (*Rows) Scan

func (s *Rows) Scan(src ...interface{}) error

type Scanner

type Scanner interface {
	Scan(...interface{}) error
}

Scanner ...

type Transactional

type Transactional interface {
	Connectionable
	Commit(ctx context.Context) error
	Rollback(ctx context.Context) error
}

Transactional ...

type Tx

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

Tx ...

func (*Tx) Begin

func (t *Tx) Begin(ctx context.Context) (Transactional, error)

Begin ...

func (*Tx) Commit

func (t *Tx) Commit(ctx context.Context) error

Commit ...

func (*Tx) Exec

func (t *Tx) Exec(ctx context.Context, sql string, args ...interface{}) (int64, error)

Exec ...

func (*Tx) Query

func (t *Tx) Query(ctx context.Context, sql string, args ...interface{}) (MultiScanner, error)

Query ...

func (*Tx) QueryRow

func (t *Tx) QueryRow(ctx context.Context, sql string, args ...interface{}) Scanner

QueryRow ...

func (*Tx) Rollback

func (t *Tx) Rollback(ctx context.Context) error

Rollback ...

Jump to

Keyboard shortcuts

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