cypher

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

View Source
const (
	CountFunction              = "count"
	DateFunction               = "date"
	TimeFunction               = "time"
	LocalTimeFunction          = "localtime"
	DateTimeFunction           = "datetime"
	LocalDateTimeFunction      = "localdatetime"
	DurationFunction           = "duration"
	IdentityFunction           = "id"
	ToLowerFunction            = "tolower"
	ToUpperFunction            = "toupper"
	NodeLabelsFunction         = "labels"
	EdgeTypeFunction           = "type"
	StartNodeFunction          = "startnode"
	EndNodeFunction            = "endnode"
	StringSplitToArrayFunction = "split"
	ToStringFunction           = "tostring"
	ToIntegerFunction          = "tointeger"
	ListSizeFunction           = "size"
	HeadFunction               = "head"
	TailFunction               = "tail"
	NodesFunction              = "nodes"
	RelationshipsFunction      = "relationships"
	CoalesceFunction           = "coalesce"
	CollectFunction            = "collect"
	SumFunction                = "sum"
	AvgFunction                = "avg"
	MinFunction                = "min"
	MaxFunction                = "max"

	// ITTC - Instant Type; Temporal Component (https://neo4j.com/docs/cypher-manual/current/functions/temporal/)
	ITTCYear              = "year"
	ITTCMonth             = "month"
	ITTCDay               = "day"
	ITTCHour              = "hour"
	ITTCMinute            = "minute"
	ITTCSecond            = "second"
	ITTCMillisecond       = "millisecond"
	ITTCMicrosecond       = "microsecond"
	ITTCNanosecond        = "nanosecond"
	ITTCTimeZone          = "timezone"
	ITTCEpochSeconds      = "epochseconds"
	ITTCEpochMilliseconds = "epochmillis"
)
View Source
const (
	TokenLiteralAsterisk = "*"

	QuantifierTypeAll     = QuantifierType("all")
	QuantifierTypeAny     = QuantifierType("any")
	QuantifierTypeNone    = QuantifierType("none")
	QuantifierTypeSingle  = QuantifierType("single")
	QuantifierTypeInvalid = QuantifierType("")

	SortAscending  = SortOrder("asc")
	SortDescending = SortOrder("desc")

	OperatorAssignment         = AssignmentOperator("=")
	OperatorAdditionAssignment = AssignmentOperator("+=")
	OperatorLabelAssignment    = AssignmentOperator("")

	OperatorAdd                  = Operator("+")
	OperatorSubtract             = Operator("-")
	OperatorMultiply             = Operator("*")
	OperatorDivide               = Operator("/")
	OperatorModulo               = Operator("%")
	OperatorPowerOf              = Operator("^")
	OperatorEquals               = Operator("=")
	OperatorRegexMatch           = Operator("=~")
	OperatorNotEquals            = Operator("<>")
	OperatorGreaterThan          = Operator(">")
	OperatorGreaterThanOrEqualTo = Operator(">=")
	OperatorLessThan             = Operator("<")
	OperatorLessThanOrEqualTo    = Operator("<=")
	OperatorStartsWith           = Operator("starts with")
	OperatorEndsWith             = Operator("ends with")
	OperatorContains             = Operator("contains")
	OperatorIn                   = Operator("in")
	OperatorIs                   = Operator("is")
	OperatorIsNot                = Operator("is not")
	OperatorNot                  = Operator("not")
	OperatorAnd                  = Operator("and")
	OperatorOr                   = Operator("or")
	OperatorInvalid              = Operator("")
)

Variables

View Source
var ErrEmptyPropertyKeyName = errors.New("property key name must not be empty")
View Source
var (
	GreedyRangeQuantifier = NewRangeQuantifier("*")
)

Functions

func CanEmitBarePropertyKeyName added in v0.7.0

func CanEmitBarePropertyKeyName(name string) bool

CanEmitBarePropertyKeyName returns true when a raw property key can be emitted without backticks.

This is specific to Cypher property-key position, such as n.name and {name: value}. Property keys use oC_PropertyKeyName -> oC_SchemaName, where reserved words are valid bare names, unlike variable or parameter symbols. Empty keys and keys containing characters outside the unescaped symbolic-name grammar return false; non-empty keys outside the bare grammar are still representable by EscapePropertyKeyName using backticks.

func Copy

func Copy[T any](value T, extensions ...CopyExtension[T]) T

func EscapePropertyKeyName added in v0.7.0

func EscapePropertyKeyName(name string) string

EscapePropertyKeyName formats a raw property key as a Cypher property-key token.

func IsEscapedPropertyKeyName added in v0.7.0

func IsEscapedPropertyKeyName(name string) bool

IsEscapedPropertyKeyName returns true when name is wrapped in Cypher backtick delimiters.

func NewRegularQueryWithSingleQuery added in v0.1.4

func NewRegularQueryWithSingleQuery() (*RegularQuery, *SinglePartQuery)

func UnescapePropertyKeyName added in v0.7.0

func UnescapePropertyKeyName(name string) string

UnescapePropertyKeyName decodes a Cypher property-key token into the raw property key it names.

func ValidatePropertyKeyName added in v0.7.0

func ValidatePropertyKeyName(name string) error

func WithErrors

func WithErrors[T Fallible](fallible T, errs ...error) T

Types

type ArithmeticExpression

type ArithmeticExpression struct {
	Left     Expression
	Partials []*PartialArithmeticExpression
}

func NewArithmeticExpression

func NewArithmeticExpression() *ArithmeticExpression

func (*ArithmeticExpression) AddArithmeticExpressionPart

func (s *ArithmeticExpression) AddArithmeticExpressionPart(part *PartialArithmeticExpression)

type AssignmentOperator

type AssignmentOperator string

func (AssignmentOperator) String

func (s AssignmentOperator) String() string

type Comparison

type Comparison struct {
	Left     Expression
	Partials []*PartialComparison
}

func NewComparison

func NewComparison(left Expression, operator Operator, right Expression) *Comparison

func (*Comparison) AddPartialComparison

func (s *Comparison) AddPartialComparison(partial *PartialComparison)

func (*Comparison) FirstPartial

func (s *Comparison) FirstPartial() *PartialComparison

func (*Comparison) LastPartial

func (s *Comparison) LastPartial() *PartialComparison

func (*Comparison) NewPartialComparison added in v0.1.4

func (s *Comparison) NewPartialComparison(operator Operator, rightOperand Expression) *PartialComparison

type Conjunction

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

func NewConjunction

func NewConjunction(expressions ...Expression) *Conjunction

func (*Conjunction) Add

func (s *Conjunction) Add(expression Expression)

func (*Conjunction) AddSlice

func (s *Conjunction) AddSlice(expressions []Expression)

func (*Conjunction) Get

func (s *Conjunction) Get(index int) Expression

func (*Conjunction) GetAll

func (s *Conjunction) GetAll() []Expression

func (*Conjunction) IndexOf

func (s *Conjunction) IndexOf(expressionToFind Expression) int

func (*Conjunction) Len

func (s *Conjunction) Len() int

func (*Conjunction) Remove

func (s *Conjunction) Remove(expressionToRemove Expression) bool

func (*Conjunction) Replace

func (s *Conjunction) Replace(index int, expression Expression)

type CopyExtension

type CopyExtension[T any] func(value T) (T, bool)

type Create

type Create struct {
	Unique  bool
	Pattern []*PatternPart
	// contains filtered or unexported fields
}

func NewCreate

func NewCreate() *Create

func (*Create) AddError

func (s *Create) AddError(err error)

func (*Create) Errors

func (s *Create) Errors() []error

type Delete

type Delete struct {
	Detach      bool
	Expressions []Expression
}

func NewDelete

func NewDelete(detach bool, expressions []Expression) *Delete

func (*Delete) AddExpression added in v0.1.4

func (s *Delete) AddExpression(expression Expression)

type Disjunction

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

func NewDisjunction

func NewDisjunction(expressions ...Expression) *Disjunction

func (*Disjunction) Add

func (s *Disjunction) Add(expression Expression)

func (*Disjunction) AddSlice

func (s *Disjunction) AddSlice(expressions []Expression)

func (*Disjunction) Get

func (s *Disjunction) Get(index int) Expression

func (*Disjunction) GetAll

func (s *Disjunction) GetAll() []Expression

func (*Disjunction) IndexOf

func (s *Disjunction) IndexOf(expressionToFind Expression) int

func (*Disjunction) Len

func (s *Disjunction) Len() int

func (*Disjunction) Remove

func (s *Disjunction) Remove(expressionToRemove Expression) bool

func (*Disjunction) Replace

func (s *Disjunction) Replace(index int, expression Expression)

type ExclusiveDisjunction

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

func NewExclusiveDisjunction

func NewExclusiveDisjunction(expressions ...Expression) *ExclusiveDisjunction

func (*ExclusiveDisjunction) Add

func (s *ExclusiveDisjunction) Add(expression Expression)

func (*ExclusiveDisjunction) AddSlice

func (s *ExclusiveDisjunction) AddSlice(expressions []Expression)

func (*ExclusiveDisjunction) Get

func (s *ExclusiveDisjunction) Get(index int) Expression

func (*ExclusiveDisjunction) GetAll

func (s *ExclusiveDisjunction) GetAll() []Expression

func (*ExclusiveDisjunction) IndexOf

func (s *ExclusiveDisjunction) IndexOf(expressionToFind Expression) int

func (*ExclusiveDisjunction) Len

func (s *ExclusiveDisjunction) Len() int

func (*ExclusiveDisjunction) Remove

func (s *ExclusiveDisjunction) Remove(expressionToRemove Expression) bool

func (*ExclusiveDisjunction) Replace

func (s *ExclusiveDisjunction) Replace(index int, expression Expression)

type Expression

type Expression SyntaxNode

type ExpressionList

type ExpressionList interface {
	Add(expression Expression)
	AddSlice(expressions []Expression)
	Get(index int) Expression
	GetAll() []Expression
	Len() int
	IndexOf(expression Expression) int
	Remove(expression Expression) bool
	Replace(index int, expression Expression)
}

func NewExpressionList

func NewExpressionList() ExpressionList

func NewExpressionListFromSlice

func NewExpressionListFromSlice(slice []Expression) ExpressionList

type Fallible

type Fallible interface {
	AddError(err error)
	Errors() []error
}

type FilterExpression

type FilterExpression struct {
	Specifier *IDInCollection
	Where     *Where
}

func NewFilterExpression

func NewFilterExpression() *FilterExpression

type FunctionInvocation

type FunctionInvocation struct {
	Distinct  bool
	Namespace []string
	Name      string
	Arguments []Expression
	// contains filtered or unexported fields
}

func NewSimpleFunctionInvocation

func NewSimpleFunctionInvocation(name string, arguments ...Expression) *FunctionInvocation

func (*FunctionInvocation) AddArgument

func (s *FunctionInvocation) AddArgument(arg Expression)

func (*FunctionInvocation) AddError

func (s *FunctionInvocation) AddError(err error)

func (*FunctionInvocation) Errors

func (s *FunctionInvocation) Errors() []error

func (*FunctionInvocation) HasArguments

func (s *FunctionInvocation) HasArguments() bool

func (*FunctionInvocation) NumArguments

func (s *FunctionInvocation) NumArguments() int

type IDInCollection

type IDInCollection struct {
	Variable   *Variable
	Expression Expression
}

func NewIDInCollection

func NewIDInCollection() *IDInCollection

type KindMatcher

type KindMatcher struct {
	Reference Expression
	Kinds     graph.Kinds
	// IsExclusive changes the kind matching operator from overlap (PG &&) to a stricter "left contains right" (PG @>)
	IsExclusive bool
}

func NewKindMatcher

func NewKindMatcher(reference Expression, kinds graph.Kinds, isExclusive bool) *KindMatcher

type Limit

type Limit struct {
	Value Expression
}

func NewLimit added in v0.1.4

func NewLimit(limit int) *Limit

type ListLiteral

type ListLiteral []Expression

func NewListLiteral

func NewListLiteral() *ListLiteral

func NewStringListLiteral added in v0.1.4

func NewStringListLiteral(values []string) *ListLiteral

func (*ListLiteral) Expressions

func (s *ListLiteral) Expressions() []Expression

func (*ListLiteral) Keys

func (s *ListLiteral) Keys() []any

type Literal

type Literal struct {
	Value any
	Null  bool
}

Literal is a Cypher AST node representing a literal value (string, integer, float, boolean, list, map, or null).

String values carry a representation contract that callers must respect: when Value holds a string, it must be in Cypher source form, meaning the raw token as it would appear in a query, including the surrounding quote characters (' or ") and with all escape sequences left un-decoded (\\, \', \", \b, \f, \n, \r, \t). Non-ASCII characters are carried as raw UTF-8 bytes inside the literal body. The parser stores string literals in this form so that the AST round-trips back to source verbatim via the format package, and downstream backends (for example the PgSQL translator) decode the source form into the final byte sequence before emitting their target language.

Use NewStringLiteral to construct a string-valued Literal from an arbitrary Go string; it performs the required quoting and escaping. Constructing a Literal directly with a raw, un-quoted Go string in Value will be rejected at translation time.

Non-string values (int, float64, bool, etc.) are stored as-is and are not subject to the source-form contract. Null literals set Null to true and leave Value unused.

func NewLiteral

func NewLiteral(value any, null bool) *Literal

NewLiteral constructs a Literal wrapping the provided value.

This constructor does not transform value in any way. When passing a string, the caller is responsible for ensuring it is already in Cypher source form (surrounding quotes present, special characters escaped); see the Literal type documentation for the full contract. For arbitrary Go strings, prefer NewStringLiteral, which performs the quoting and escaping for you.

For non-string values (numbers, booleans) value is stored verbatim. To represent a Cypher null, pass null=true.

func NewStringLiteral

func NewStringLiteral(value string) *Literal

NewStringLiteral constructs a string-valued Literal from an arbitrary Go string, producing the Cypher source-form representation required by the Literal contract.

The input is escaped for Cypher single-quoted string literals — every backslash is doubled (\ becomes \\) and every single quote is escaped (' becomes \') — and then wrapped in surrounding single quotes. The resulting Literal.Value is a Cypher source token equivalent to what the parser would have produced for the same input, so it round-trips correctly through emitters and is decoded back to the original byte sequence by translator backends.

Example: NewStringLiteral(`TEST\PS1`) yields Value == `'TEST\\PS1'`.

func (*Literal) Set

func (s *Literal) Set(value any) *Literal

func (*Literal) SetNull

func (s *Literal) SetNull() *Literal

type MapItem

type MapItem struct {
	Key   string
	Value Expression
}

type MapLiteral

type MapLiteral map[string]Expression

func NewMapLiteral

func NewMapLiteral() MapLiteral

func (MapLiteral) ForEachItem added in v0.6.0

func (s MapLiteral) ForEachItem(delegate func(key string, value Expression) error) error

func (MapLiteral) Items

func (s MapLiteral) Items() []*MapItem

func (MapLiteral) Keys

func (s MapLiteral) Keys() []any

type Match

type Match struct {
	Optional bool
	Pattern  []*PatternPart
	Where    *Where
}

func NewMatch

func NewMatch(optional bool) *Match

func (*Match) FirstRelationshipPattern

func (s *Match) FirstRelationshipPattern() *RelationshipPattern

func (*Match) NewPatternPart added in v0.1.4

func (s *Match) NewPatternPart() *PatternPart

func (*Match) NewWhere added in v0.1.4

func (s *Match) NewWhere() *Where

type Merge

type Merge struct {
	PatternPart  *PatternPart
	MergeActions []*MergeAction
}

type MergeAction

type MergeAction struct {
	OnCreate bool
	OnMatch  bool
	Set      *Set
}

type MultiPartQuery

type MultiPartQuery struct {
	Parts           []*MultiPartQueryPart
	SinglePartQuery *SinglePartQuery
}

func NewMultiPartQuery

func NewMultiPartQuery() *MultiPartQuery

func (*MultiPartQuery) AppendPart

func (s *MultiPartQuery) AppendPart()

func (*MultiPartQuery) CurrentPart

func (s *MultiPartQuery) CurrentPart() *MultiPartQueryPart

type MultiPartQueryPart

type MultiPartQueryPart struct {
	ReadingClauses  []*ReadingClause
	UpdatingClauses []*UpdatingClause
	With            *With
}

func NewMultiPartQueryPart

func NewMultiPartQueryPart() *MultiPartQueryPart

func (*MultiPartQueryPart) AddReadingClause

func (s *MultiPartQueryPart) AddReadingClause(clause *ReadingClause)

func (*MultiPartQueryPart) AddUpdatingClause

func (s *MultiPartQueryPart) AddUpdatingClause(clause *UpdatingClause)

type Negation

type Negation struct {
	Expression Expression
}

func NewNegation

func NewNegation(expression Expression) *Negation

type NodePattern

type NodePattern struct {
	Variable   *Variable
	Kinds      graph.Kinds
	Properties Expression
}

NodePattern

func (*NodePattern) AddKind

func (s *NodePattern) AddKind(kind graph.Kind)

type Operator

type Operator string

func ParseOperator

func ParseOperator(operator string) (Operator, error)

func (Operator) String

func (s Operator) String() string

type Order

type Order struct {
	Items []*SortItem
}

func (*Order) AddItem

func (s *Order) AddItem(item *SortItem)

type Parameter

type Parameter struct {
	Symbol string
	Value  any
}

func NewParameter

func NewParameter(symbol string, value any) *Parameter

type Parenthetical

type Parenthetical struct {
	Expression Expression
}

func NewParenthetical

func NewParenthetical(expression Expression) *Parenthetical

type PartialArithmeticExpression

type PartialArithmeticExpression struct {
	Operator Operator
	Right    Expression
}

func NewArithmeticExpressionPart

func NewArithmeticExpressionPart(operator Operator) *PartialArithmeticExpression

type PartialComparison

type PartialComparison struct {
	Operator Operator
	Right    Expression
}

func NewPartialComparison added in v0.1.4

func NewPartialComparison(operator Operator, right Expression) *PartialComparison

type PatternElement

type PatternElement struct {
	Element Expression
}

func (*PatternElement) AsNodePattern

func (s *PatternElement) AsNodePattern() (*NodePattern, bool)

func (*PatternElement) AsRelationshipPattern

func (s *PatternElement) AsRelationshipPattern() (*RelationshipPattern, bool)

func (*PatternElement) IsNodePattern

func (s *PatternElement) IsNodePattern() bool

func (*PatternElement) IsRelationshipPattern

func (s *PatternElement) IsRelationshipPattern() bool

type PatternPart

type PatternPart struct {
	Variable                *Variable
	ShortestPathPattern     bool
	AllShortestPathsPattern bool
	PatternElements         []*PatternElement

	// PathDirectionReversed indicates the optimizer reversed this pattern's element order and
	// relationship directions so the traversal can be driven from the more selective terminal
	// endpoint. Downstream translation compensates for this when materializing a bound path so
	// that the path renders in its original left-to-right logical order.
	PathDirectionReversed bool
}

func NewPatternPart

func NewPatternPart() *PatternPart

func (*PatternPart) AddPatternElements

func (s *PatternPart) AddPatternElements(nextElements ...Expression) *PatternPart

func (*PatternPart) CurrentElement

func (s *PatternPart) CurrentElement() any

type PatternPredicate

type PatternPredicate struct {
	PatternElements []*PatternElement
}

func NewPatternPredicate

func NewPatternPredicate() *PatternPredicate

func (*PatternPredicate) AddElement

func (s *PatternPredicate) AddElement(element Expression)

type PatternRange

type PatternRange struct {
	StartIndex *int64
	EndIndex   *int64
}

func NewPatternRange

func NewPatternRange(start, end *int64) *PatternRange

type Projection

type Projection struct {
	Distinct bool
	All      bool
	Order    *Order
	Skip     *Skip
	Limit    *Limit
	Items    []Expression
}

func NewProjection

func NewProjection(distinct bool) *Projection

func (*Projection) AddItem

func (s *Projection) AddItem(item *ProjectionItem)

type ProjectionItem

type ProjectionItem struct {
	Expression Expression
	Alias      *Variable
}

func NewGreedyProjectionItem

func NewGreedyProjectionItem() *ProjectionItem

func NewProjectionItem

func NewProjectionItem() *ProjectionItem

func NewProjectionItemWithExpr added in v0.1.4

func NewProjectionItemWithExpr(expr Expression) *ProjectionItem

type Properties

type Properties struct {
	Map       MapLiteral
	Parameter *Parameter
}

func NewProperties

func NewProperties() *Properties

type PropertyLookup

type PropertyLookup struct {
	Atom Expression

	// Symbol is the raw property key, not an already-rendered Cypher token.
	// Callers should not pre-wrap names in backticks; formatting handles that.
	Symbol string
}

func NewPropertyLookup

func NewPropertyLookup(variableSymbol string, propertySymbol string) *PropertyLookup

func (*PropertyLookup) SetSymbol

func (s *PropertyLookup) SetSymbol(symbol string)

type Quantifier

type Quantifier struct {
	Type   QuantifierType
	Filter *FilterExpression
}

func NewQuantifier

func NewQuantifier(quantifierType QuantifierType) *Quantifier

type QuantifierType

type QuantifierType string

func (QuantifierType) String

func (s QuantifierType) String() string

type RangeQuantifier

type RangeQuantifier struct {
	Value string
}

func NewRangeQuantifier

func NewRangeQuantifier(value string) *RangeQuantifier

type ReadingClause

type ReadingClause struct {
	Match  *Match
	Unwind *Unwind
}

func NewReadingClause

func NewReadingClause() *ReadingClause

func (*ReadingClause) NewMatch added in v0.1.4

func (s *ReadingClause) NewMatch(optional bool) *Match

type RegularQuery

type RegularQuery struct {
	SingleQuery *SingleQuery
}

func NewRegularQuery

func NewRegularQuery() *RegularQuery

type RelationshipPattern

type RelationshipPattern struct {
	Variable   *Variable
	Kinds      graph.Kinds
	Direction  graph.Direction
	Range      *PatternRange
	Properties Expression
}

RelationshipPattern

func (*RelationshipPattern) AddKind

func (s *RelationshipPattern) AddKind(kind graph.Kind)

type Remove

type Remove struct {
	Items []*RemoveItem
}

func NewRemove

func NewRemove(items []*RemoveItem) *Remove

type RemoveItem

type RemoveItem struct {
	KindMatcher *KindMatcher
	Property    Expression
}

func RemoveKindsByMatcher added in v0.1.4

func RemoveKindsByMatcher(kindMatcher *KindMatcher) *RemoveItem

func RemoveProperty added in v0.1.4

func RemoveProperty(propertyLookup Expression) *RemoveItem

type Return

type Return struct {
	Projection *Projection
}

func NewReturn

func NewReturn() *Return

func (*Return) NewProjection added in v0.1.4

func (s *Return) NewProjection(distinct bool) *Projection

type Set

type Set struct {
	Items []*SetItem
}

func NewSet

func NewSet(items []*SetItem) *Set

type SetItem

type SetItem struct {
	Left     Expression
	Operator AssignmentOperator
	Right    Expression
}

func NewSetItem

func NewSetItem(lOperand Expression, operator AssignmentOperator, rOperand Expression) *SetItem

type SinglePartQuery

type SinglePartQuery struct {
	ReadingClauses  []*ReadingClause
	UpdatingClauses []Expression
	Return          *Return
	// contains filtered or unexported fields
}

func NewSinglePartQuery

func NewSinglePartQuery() *SinglePartQuery

func (*SinglePartQuery) AddError

func (s *SinglePartQuery) AddError(err error)

func (*SinglePartQuery) AddReadingClause

func (s *SinglePartQuery) AddReadingClause(clause *ReadingClause)

func (*SinglePartQuery) AddUpdatingClause

func (s *SinglePartQuery) AddUpdatingClause(clause *UpdatingClause)

func (*SinglePartQuery) Errors

func (s *SinglePartQuery) Errors() []error

func (*SinglePartQuery) NewMatch added in v0.1.4

func (s *SinglePartQuery) NewMatch(optional bool) *Match

func (*SinglePartQuery) NewProjection added in v0.1.4

func (s *SinglePartQuery) NewProjection(distinct bool) *Projection

func (*SinglePartQuery) NewReadingClause added in v0.1.4

func (s *SinglePartQuery) NewReadingClause() *ReadingClause

type SingleQuery

type SingleQuery struct {
	SinglePartQuery *SinglePartQuery
	MultiPartQuery  *MultiPartQuery
}

func NewSingleQuery

func NewSingleQuery() *SingleQuery

type Skip

type Skip struct {
	Value Expression
}

func NewSkip

func NewSkip(skip int) *Skip

type SortItem

type SortItem struct {
	Ascending  bool
	Expression Expression
}

type SortOrder

type SortOrder string

func (SortOrder) String

func (s SortOrder) String() string

type SyntaxNode

type SyntaxNode any

type UnaryAddOrSubtractExpression

type UnaryAddOrSubtractExpression struct {
	Operator Operator
	Right    Expression
}

func NewUnaryAddOrSubtractExpression

func NewUnaryAddOrSubtractExpression() *UnaryAddOrSubtractExpression

type Unwind

type Unwind struct {
	Expression Expression
	Variable   *Variable
}

func NewUnwind

func NewUnwind() *Unwind

type UpdatingClause

type UpdatingClause struct {
	Clause Expression
	// contains filtered or unexported fields
}

func NewUpdatingClause

func NewUpdatingClause[T *Delete | *Remove | *Set | *Create | *Merge](clause T) *UpdatingClause

func (*UpdatingClause) AddError

func (s *UpdatingClause) AddError(err error)

func (*UpdatingClause) Errors

func (s *UpdatingClause) Errors() []error

type Variable

type Variable struct {
	Symbol string
}

func NewVariable

func NewVariable() *Variable

func NewVariableWithSymbol

func NewVariableWithSymbol(symbol string) *Variable

type Where

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

func NewWhere

func NewWhere() *Where

func (*Where) Add

func (s *Where) Add(expression Expression)

func (*Where) AddSlice

func (s *Where) AddSlice(expressions []Expression)

func (*Where) Get

func (s *Where) Get(index int) Expression

func (*Where) GetAll

func (s *Where) GetAll() []Expression

func (*Where) IndexOf

func (s *Where) IndexOf(expressionToFind Expression) int

func (*Where) Len

func (s *Where) Len() int

func (*Where) Remove

func (s *Where) Remove(expressionToRemove Expression) bool

func (*Where) Replace

func (s *Where) Replace(index int, expression Expression)

type With

type With struct {
	Projection *Projection
	Where      *Where
}

func NewWith

func NewWith() *With

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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