projection

package
v0.0.0-...-b19370d Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapExpressionToField

func MapExpressionToField(e impls.Expression, targetRelationName string, proj ProjectedExpression) impls.Expression

func MapFieldToExpression

func MapFieldToExpression(e impls.Expression, field fields.Field, target impls.Expression) impls.Expression

Types

type AliasedTable

type AliasedTable struct {
	TableName string
	Alias     string
}

type ProjectedExpression

type ProjectedExpression struct {
	Expression impls.Expression
	Alias      string
	IsTID      bool
}

func ExpandProjection

func ExpandProjection(fields []fields.Field, expressions []ProjectionExpression, aliasedTables []AliasedTable) ([]ProjectedExpression, error)

func NewProjectedExpression

func NewProjectedExpression(expression impls.Expression, alias string, isTID bool) ProjectedExpression

func NewProjectedExpressionFromField

func NewProjectedExpressionFromField(field fields.Field) ProjectedExpression

func (ProjectedExpression) String

func (p ProjectedExpression) String() string

type Projection

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

func NewProjection

func NewProjection(
	targetRelationName string,
	projectedExpressions []ProjectedExpression,
) (*Projection, error)

func (*Projection) Aliases

func (p *Projection) Aliases() []ProjectedExpression

func (*Projection) DeprojectExpression

func (p *Projection) DeprojectExpression(expression impls.Expression) impls.Expression

func (*Projection) Fields

func (p *Projection) Fields() []fields.Field

func (*Projection) Optimize

func (p *Projection) Optimize(ctx impls.OptimizationContext)

func (*Projection) ProjectExpression

func (p *Projection) ProjectExpression(expression impls.Expression) impls.Expression

func (*Projection) String

func (p *Projection) String() string

type ProjectionExpression

type ProjectionExpression interface {
	Expand(fields []fields.Field, aliasedTables []AliasedTable) ([]ProjectedExpression, error)
}

func NewAliasedExpression

func NewAliasedExpression(expression impls.Expression, alias string, isTID bool) ProjectionExpression

func NewAliasedExpressionFromField

func NewAliasedExpressionFromField(field fields.Field) ProjectionExpression

func NewTableWildcardProjectionExpression

func NewTableWildcardProjectionExpression(relationName string) ProjectionExpression

func NewWildcardProjectionExpression

func NewWildcardProjectionExpression() ProjectionExpression

Jump to

Keyboard shortcuts

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