query

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableContexts = "contexts"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultExpression

type DefaultExpression struct {
	Contains   string
	Expression string
}

type Json

type Json struct {
	clause.Column
	JsonPath  string
	Dialector string
}

Json clause for string match at a json path.

func (Json) Build

func (json Json) Build(builder clause.Builder)

Build builds positive statement.

func (Json) NegationBuild

func (json Json) NegationBuild(builder clause.Builder)

NegationBuild builds negative statement.

type JsonEq

type JsonEq struct {
	Left      Json
	Value     any
	Dialector string
}

func (JsonEq) Build

func (eq JsonEq) Build(builder clause.Builder)

func (JsonEq) NegationBuild

func (eq JsonEq) NegationBuild(builder clause.Builder)

type JsonLike

type JsonLike struct {
	Json  Json
	Value any
}

JsonLike like for where clause.

func (JsonLike) Build

func (jl JsonLike) Build(builder clause.Builder)

Build renders the Json like expression.

func (JsonLike) NegationBuild

func (jl JsonLike) NegationBuild(builder clause.Builder)

NegationBuild renders the Json not-like expression.

type JsonNeq

type JsonNeq JsonEq

JsonNeq not equal to for where

func (JsonNeq) Build

func (neq JsonNeq) Build(builder clause.Builder)

func (JsonNeq) NegationBuild

func (neq JsonNeq) NegationBuild(builder clause.Builder)

type JsonNotLike

type JsonNotLike JsonLike

JsonNotLike not like for where.

func (JsonNotLike) Build

func (jnl JsonNotLike) Build(builder clause.Builder)

Build renders the Json not-like expression.

func (JsonNotLike) NegationBuild

func (jnl JsonNotLike) NegationBuild(builder clause.Builder)

NegationBuild renders the Json like expression.

type ParsedQuery

type ParsedQuery interface {
	Filter(*gorm.DB) *gorm.DB
}

type QueryParser

type QueryParser struct {
	Default   DefaultExpression
	Tables    map[string]string
	TzOffset  int
	Dialector string
}

func (*QueryParser) Parse

func (qp *QueryParser) Parse(q string) (ParsedQuery, error)

type Regexp

type Regexp struct {
	clause.Eq
	Dialector string
}

Regexp whether string matches regular expression

func (Regexp) Build

func (regexp Regexp) Build(builder clause.Builder)

Build builds positive statement.

func (Regexp) NegationBuild

func (regexp Regexp) NegationBuild(builder clause.Builder)

NegationBuild builds negative statement.

type SyntaxError

type SyntaxError struct {
	Statement string `json:"statement"`
	Line      int    `json:"line"`
	Offset    int    `json:"offset"`
	EndOffset int    `json:"end_offset"`
	Err       string `json:"error,omitempty"`
}

func (SyntaxError) Code

func (s SyntaxError) Code() int

func (SyntaxError) Detail

func (s SyntaxError) Detail() any

func (SyntaxError) Error

func (s SyntaxError) Error() string

func (SyntaxError) Is

func (s SyntaxError) Is(target error) bool

func (SyntaxError) Message

func (s SyntaxError) Message() string

Jump to

Keyboard shortcuts

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