query

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 8 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPageTooBig = errors.New("page too big")
View Source
var File_query_v1_pagination_proto protoreflect.FileDescriptor
View Source
var File_query_v1_sort_proto protoreflect.FileDescriptor

Functions

func InOrEq added in v1.1.2

func InOrEq[I, T any](tx IWhere[I], key string, val []T, format ...func(any) any) I

InOrEq use

InOrEq[uint64](nil, "key", []uint64{1, 2}) InOrEq[uint64](nil, "key", []uint64{1, 2}, func(a any) any { return bun.In(a) })

func InOrEqSafe added in v1.1.2

func InOrEqSafe[I, T any](tx IWhere[I], key any, val []T, format ...func(any) any) I

InOrEqSafe use

InOrEqSafe[uint64](nil, bun.Ident("key"), []uint64{1, 2}) InOrEqSafe[uint64](nil, bun.Ident("key"), []uint64{1, 2}, func(a any) any { return bun.In(a) })

func OrLikeEq added in v1.1.2

func OrLikeEq[I any](tx IWhereOr[I], key string, val []string, format ...func(any) any) I

func UsePagination added in v1.1.2

func UsePagination[I any](x *Pagination, tx interface {
	IErr[I]
	ILimit[I]
	IOffset[I]
}) I

func UseSort added in v1.1.2

func UseSort[I any](x []*Sort, tx IOrder[I]) I

func WhereStruct added in v1.1.2

func WhereStruct[I any](tx interface {
	IWhere[I]
	IErr[I]
}, qk string, val *structpb.Struct) I

Types

type IErr added in v1.1.2

type IErr[I any] interface {
	Err(error) I
}

type ILimit added in v1.1.2

type ILimit[I any] interface {
	Limit(int) I
}

type IOffset added in v1.1.2

type IOffset[I any] interface {
	Offset(int) I
}

type IOrder added in v1.1.2

type IOrder[I any] interface {
	Order(...string) I
}

type IWhere added in v1.1.2

type IWhere[I any] interface {
	Where(query string, args ...any) I
}

type IWhereOr added in v1.1.2

type IWhereOr[I any] interface {
	WhereOr(query string, args ...any) I
}

type Pagination

type Pagination struct {
	Page     int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// contains filtered or unexported fields
}

func (*Pagination) Descriptor deprecated

func (*Pagination) Descriptor() ([]byte, []int)

Deprecated: Use Pagination.ProtoReflect.Descriptor instead.

func (*Pagination) GetPage

func (x *Pagination) GetPage() int64

func (*Pagination) GetPageSize

func (x *Pagination) GetPageSize() int64

func (*Pagination) ProtoMessage

func (*Pagination) ProtoMessage()

func (*Pagination) ProtoReflect

func (x *Pagination) ProtoReflect() protoreflect.Message

func (*Pagination) Reset

func (x *Pagination) Reset()

func (*Pagination) String

func (x *Pagination) String() string

type Sort

type Sort struct {

	// Types that are assignable to Key:
	//
	//	*Sort_Asc
	//	*Sort_Desc
	Key isSort_Key `protobuf_oneof:"key"`
	// contains filtered or unexported fields
}

func (*Sort) Descriptor deprecated

func (*Sort) Descriptor() ([]byte, []int)

Deprecated: Use Sort.ProtoReflect.Descriptor instead.

func (*Sort) GetAsc

func (x *Sort) GetAsc() string

func (*Sort) GetDesc

func (x *Sort) GetDesc() string

func (*Sort) GetKey

func (m *Sort) GetKey() isSort_Key

func (*Sort) ProtoMessage

func (*Sort) ProtoMessage()

func (*Sort) ProtoReflect

func (x *Sort) ProtoReflect() protoreflect.Message

func (*Sort) Reset

func (x *Sort) Reset()

func (*Sort) String

func (x *Sort) String() string

type Sort_Asc

type Sort_Asc struct {
	Asc string `protobuf:"bytes,1,opt,name=asc,proto3,oneof"`
}

type Sort_Desc

type Sort_Desc struct {
	Desc string `protobuf:"bytes,2,opt,name=desc,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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