pgmodel

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 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 interface{}, filter ...Filter) error

Types

type Filter

type Filter interface {
	Apply(ctx context.Context, b pgstmt.SelectStatement)
}

func Equal

func Equal(field string, value interface{}) 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 pgstmt.SelectStatement)

func (FilterFunc) Apply

type Selector

type Selector interface {
	Select(b pgstmt.SelectStatement)
	Scan(scan pgsql.Scanner) error
}

Selector model

Jump to

Keyboard shortcuts

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