sql

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BoolAnd       = "AND"
	BoolOr        = "OR"
	DirectionAsc  = "ASC"
	DirectionDesc = "DESC"
	OpEq          = "="
	OpGt          = ">"
	OpGte         = ">="
	OpIs          = "IS"
	OpIsNot       = "IS NOT"
	OpLike        = "~"
	OpLt          = "<"
	OpLte         = "<="
	OpMemberOf    = "MEMBER OF"
	OpNeq         = "!="
	OpNotLike     = "!~"
	OpNotMemberOf = "NOT MEMBER OF"
	OpRawLike     = "LIKE"
	OpRawNotLike  = "NOT LIKE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Groups  []Filter      `json:"groups"`
	Matches []FilterMatch `json:"matches"`
	Bool    string        `json:"bool" validate:"oneof=AND OR"`
}

type FilterMatch

type FilterMatch struct {
	Values    []any  `json:"values"`
	Dimension string `json:"dimension"`
	Operator  string `` /* 128-byte string literal not displayed */
}

type Input

type Input struct {
	Filter  Filter   `json:"filter"`
	GroupBy []string `json:"groupBy"`
	Order   []Order  `json:"order"`
	Page    *Page    `json:"page"`
}

func NewInput

func NewInput() *Input

type Order

type Order struct {
	Direction string `json:"direction" validate:"oneof=ASC DESC"`
	Field     string `json:"field"`
}

type OrmQueryBuilder

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

func NewOrmQueryBuilder

func NewOrmQueryBuilder(metadata db_repo.Metadata) *OrmQueryBuilder

func (OrmQueryBuilder) Build

func (qb OrmQueryBuilder) Build(inp *Input) (*db_repo.QueryBuilder, error)

type Page

type Page struct {
	Limit  int `json:"limit"`
	Offset int `json:"offset"`
}

type RawQueryBuilder

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

func NewRawQueryBuilder

func NewRawQueryBuilder(metadata db_repo.Metadata) *RawQueryBuilder

func (RawQueryBuilder) Build

func (qb RawQueryBuilder) Build(inp *Input) (*db.RawQueryBuilder, error)

Jump to

Keyboard shortcuts

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