query

package
v0.0.0-...-acd9bba Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregationFunc

type AggregationFunc interface {
	fmt.Stringer
	First(s Scan) error
	Next(s Scan) error
	AliasName() schema.FieldName
	Val() schema.Constant
}

func NewCountFunc

func NewCountFunc(_, aliasName schema.FieldName) AggregationFunc

func NewMaxFunc

func NewMaxFunc(fieldName, aliasName schema.FieldName) AggregationFunc

func NewMinFunc

func NewMinFunc(fieldName, aliasName schema.FieldName) AggregationFunc

func NewSumFunc

func NewSumFunc(fieldName, aliasName schema.FieldName) AggregationFunc

type AggregationFuncInitializer

type AggregationFuncInitializer func(fieldName, aliasName schema.FieldName) AggregationFunc

type CountFunc

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

func (*CountFunc) AliasName

func (c *CountFunc) AliasName() schema.FieldName

func (*CountFunc) First

func (c *CountFunc) First(s Scan) error

func (*CountFunc) Next

func (c *CountFunc) Next(s Scan) error

func (*CountFunc) String

func (c *CountFunc) String() string

func (*CountFunc) Val

func (c *CountFunc) Val() schema.Constant

type Expression

type Expression interface {
	Evaluate(v schema.Valuable) (schema.Constant, error)
	AppliesTo(s *schema.Schema) bool
}

type MaxFunc

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

func (*MaxFunc) AliasName

func (m *MaxFunc) AliasName() schema.FieldName

func (*MaxFunc) First

func (m *MaxFunc) First(s Scan) error

func (*MaxFunc) Next

func (m *MaxFunc) Next(s Scan) error

func (*MaxFunc) String

func (m *MaxFunc) String() string

func (*MaxFunc) Val

func (m *MaxFunc) Val() schema.Constant

type MinFunc

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

func (*MinFunc) AliasName

func (m *MinFunc) AliasName() schema.FieldName

func (*MinFunc) First

func (m *MinFunc) First(s Scan) error

func (*MinFunc) Next

func (m *MinFunc) Next(s Scan) error

func (*MinFunc) String

func (m *MinFunc) String() string

func (*MinFunc) Val

func (m *MinFunc) Val() schema.Constant

type Order

type Order []OrderElement

func NewOrder

func NewOrder(elements ...OrderElement) Order

func (Order) Compare

func (o Order) Compare(s1, s2 Scan) (int, error)

func (Order) String

func (o Order) String() string

type OrderElement

type OrderElement struct {
	Field     schema.FieldName
	OrderType OrderType
}

type OrderType

type OrderType int
const (
	Asc OrderType = iota
	Desc
)

type Predicate

type Predicate []Term

func NewPredicate

func NewPredicate(terms ...Term) Predicate

func (Predicate) EquatesWithConstant

func (p Predicate) EquatesWithConstant(fieldName schema.FieldName) (schema.Constant, bool)

func (Predicate) EquatesWithField

func (p Predicate) EquatesWithField(fieldName schema.FieldName) (schema.FieldName, bool)

func (Predicate) IsSatisfied

func (p Predicate) IsSatisfied(scan Scan) (bool, error)

func (Predicate) JoinSubPred

func (p Predicate) JoinSubPred(sche1, sche2 *schema.Schema) (Predicate, bool)

func (Predicate) SelectSubPred

func (p Predicate) SelectSubPred(sche *schema.Schema) (Predicate, bool)

func (Predicate) String

func (p Predicate) String() string

func (Predicate) SwapParams

func (p Predicate) SwapParams(params map[int]schema.Constant) (Predicate, error)

type ProductScan

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

func NewProductScan

func NewProductScan(scan1, scan2 Scan) (*ProductScan, error)

func (*ProductScan) BeforeFirst

func (s *ProductScan) BeforeFirst() error

func (*ProductScan) Close

func (s *ProductScan) Close() error

func (*ProductScan) HasField

func (s *ProductScan) HasField(fieldName schema.FieldName) bool

func (*ProductScan) Int32

func (s *ProductScan) Int32(fieldName schema.FieldName) (int32, error)

func (*ProductScan) Next

func (s *ProductScan) Next() (bool, error)

func (*ProductScan) Str

func (s *ProductScan) Str(fieldName schema.FieldName) (string, error)

func (*ProductScan) Val

func (s *ProductScan) Val(fieldName schema.FieldName) (schema.Constant, error)

type ProjectScan

type ProjectScan struct {
	Scan
	// contains filtered or unexported fields
}

func NewProjectScan

func NewProjectScan(scan Scan, fieldNames ...schema.FieldName) *ProjectScan

func (*ProjectScan) HasField

func (s *ProjectScan) HasField(fieldName schema.FieldName) bool

func (*ProjectScan) Int32

func (s *ProjectScan) Int32(fieldName schema.FieldName) (int32, error)

func (*ProjectScan) Str

func (s *ProjectScan) Str(fieldName schema.FieldName) (string, error)

func (*ProjectScan) Val

func (s *ProjectScan) Val(fieldName schema.FieldName) (schema.Constant, error)

type Scan

type Scan interface {
	schema.Valuable
	BeforeFirst() error
	Next() (bool, error)
	Int32(fieldName schema.FieldName) (int32, error)
	Str(fieldName schema.FieldName) (string, error)
	HasField(fieldName schema.FieldName) bool
	Close() error
}

type SelectScan

type SelectScan struct {
	Scan
	// contains filtered or unexported fields
}

func NewSelectScan

func NewSelectScan(scan Scan, pred Predicate) *SelectScan

func (*SelectScan) Delete

func (s *SelectScan) Delete() error

func (*SelectScan) Insert

func (s *SelectScan) Insert() error

func (*SelectScan) MoveToRID

func (s *SelectScan) MoveToRID(rid schema.RID) error

func (*SelectScan) Next

func (s *SelectScan) Next() (bool, error)

func (*SelectScan) RID

func (s *SelectScan) RID() schema.RID

func (*SelectScan) SetInt32

func (s *SelectScan) SetInt32(fieldName schema.FieldName, val int32) error

func (*SelectScan) SetStr

func (s *SelectScan) SetStr(fieldName schema.FieldName, val string) error

func (*SelectScan) SetVal

func (s *SelectScan) SetVal(fieldName schema.FieldName, val schema.Constant) error

type SumFunc

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

func (*SumFunc) AliasName

func (s *SumFunc) AliasName() schema.FieldName

func (*SumFunc) First

func (s *SumFunc) First(scan Scan) error

func (*SumFunc) Next

func (s *SumFunc) Next(scan Scan) error

func (*SumFunc) String

func (s *SumFunc) String() string

func (*SumFunc) Val

func (s *SumFunc) Val() schema.Constant

type Term

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

func NewTerm

func NewTerm(lhs, rhs Expression) Term

func (Term) AppliesTo

func (t Term) AppliesTo(s *schema.Schema) bool

func (Term) EquatesWithConstant

func (t Term) EquatesWithConstant(fieldName schema.FieldName) (schema.Constant, bool)

func (Term) EquatesWithField

func (t Term) EquatesWithField(fieldName schema.FieldName) (schema.FieldName, bool)

func (Term) Expressions

func (t Term) Expressions() (lhs, rhs Expression)

func (Term) IsSatisfied

func (t Term) IsSatisfied(scan Scan) (bool, error)

func (Term) ReductionFactor

func (t Term) ReductionFactor(distinctValues func(fn schema.FieldName) int) int

func (Term) String

func (t Term) String() string

type UpdateScan

type UpdateScan interface {
	Scan
	SetVal(fieldName schema.FieldName, val schema.Constant) error
	SetInt32(fieldName schema.FieldName, val int32) error
	SetStr(fieldName schema.FieldName, val string) error
	Insert() error
	Delete() error
	RID() schema.RID
	MoveToRID(rid schema.RID) error
}

Jump to

Keyboard shortcuts

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