pgmodel

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, model any, filter ...Filter) error

Types

type Cond added in v0.8.1

type Cond interface {
	Where(f func(b pgstmt.Cond))
	Having(f func(b pgstmt.Cond))
	OrderBy(col string) pgstmt.OrderBy
	Limit(n int64)
	Offset(n int64)
}

type Filter

type Filter interface {
	Apply(ctx context.Context, b Cond) error
}

func Equal

func Equal(field string, value any) Filter

func Having

func Having(f func(b pgstmt.Cond)) Filter

func Limit

func Limit(n int64) Filter

func Offset

func Offset(n int64) Filter

func OrderBy

func OrderBy(col string) Filter

func Where

func Where(f func(b pgstmt.Cond)) Filter

type FilterFunc

type FilterFunc func(ctx context.Context, b Cond) error

func (FilterFunc) Apply

func (f FilterFunc) Apply(ctx context.Context, b Cond) error

type Inserter added in v0.8.1

type Inserter interface {
	Insert(b pgstmt.InsertStatement)
}

Inserter model

type Scanner added in v0.8.1

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

Scanner model

type Selector

type Selector interface {
	Select(b pgstmt.SelectStatement)
	Scanner
}

Selector model

type Updater added in v0.8.1

type Updater interface {
	Update(b pgstmt.UpdateStatement)
}

Updater model

Jump to

Keyboard shortcuts

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