query

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFilterConditions

func ApplyFilterConditions(s *sqlf.Stmt, q TQueryConditions) error

Types

type FilterBy

type FilterBy struct {
	Field    string
	Operator string
	Value    string
}

type OrderBy

type OrderBy struct {
	Field      string
	Descending bool
}

type QueryConditions

type QueryConditions struct {
	TQueryConditions
	// contains filtered or unexported fields
}

func NewQueryConditions

func NewQueryConditions(f *SQLFWhere) *QueryConditions

func (*QueryConditions) AppendSort

func (o *QueryConditions) AppendSort(f string, d bool)

func (QueryConditions) Filter

func (o QueryConditions) Filter() *SQLFWhere

func (QueryConditions) Limit

func (o QueryConditions) Limit() *uint64

func (QueryConditions) Offset

func (o QueryConditions) Offset() *uint64

func (*QueryConditions) SetFilter

func (o *QueryConditions) SetFilter(filter *SQLFWhere)

func (*QueryConditions) SetLimit

func (o *QueryConditions) SetLimit(l uint64)

func (*QueryConditions) SetOffset

func (o *QueryConditions) SetOffset(l uint64)

func (QueryConditions) Sort

func (o QueryConditions) Sort() []OrderBy

type QueryResults

type QueryResults struct {
	TQueryResults
	// contains filtered or unexported fields
}

func (*QueryResults) AppendSort

func (o *QueryResults) AppendSort(f string, d bool)

func (*QueryResults) AppendValue

func (o *QueryResults) AppendValue(v interface{})

func (QueryResults) Count

func (o QueryResults) Count() uint64

func (QueryResults) Items

func (o QueryResults) Items() []interface{}

func (QueryResults) Limit

func (o QueryResults) Limit() uint64

func (QueryResults) MaxCount

func (o QueryResults) MaxCount() uint64

func (QueryResults) MaxLimit

func (o QueryResults) MaxLimit() uint64

func (QueryResults) Offset

func (o QueryResults) Offset() uint64

func (*QueryResults) SetLimit

func (o *QueryResults) SetLimit(l uint64)

func (*QueryResults) SetMaxCount

func (o *QueryResults) SetMaxCount(c uint64)

func (*QueryResults) SetMaxLimit

func (o *QueryResults) SetMaxLimit(l uint64)

func (*QueryResults) SetOffset

func (o *QueryResults) SetOffset(l uint64)

func (QueryResults) Sorted

func (o QueryResults) Sorted() []OrderBy

type SQLFWhere

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

func (*SQLFWhere) Args

func (a *SQLFWhere) Args() []interface{}

func (*SQLFWhere) IsValid

func (a *SQLFWhere) IsValid() bool

func (*SQLFWhere) Reset

func (a *SQLFWhere) Reset()

func (*SQLFWhere) Transpile

func (a *SQLFWhere) Transpile() string

func (*SQLFWhere) Where

func (a *SQLFWhere) Where() string

type TMapFieldNameExternalToORM

type TMapFieldNameExternalToORM = func(p string) string

Map External Field Name to ORM Field Name

type TMapFieldValueExternalToORM

type TMapFieldValueExternalToORM = func(string, interface{}) interface{}

Map External Field Value to ORM Field Value

type TQueryConditions

type TQueryConditions interface {
	Filter() *SQLFWhere
	Sort() []OrderBy
	Offset() *uint64
	Limit() *uint64
}

type TQueryResults

type TQueryResults interface {
	Items() []interface{}
	Sorted() []OrderBy
	Offset() uint64
	Limit() uint64
	MaxLimit() uint64
	Count() uint64
	MaxCount() uint64
}

Jump to

Keyboard shortcuts

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