Documentation
¶
Index ¶
- Constants
- Variables
- func Copy[T any](value T, extensions ...CopyExtension[T]) T
- func NewRegularQueryWithSingleQuery() (*RegularQuery, *SinglePartQuery)
- func WithErrors[T Fallible](fallible T, errs ...error) T
- type ArithmeticExpression
- type AssignmentOperator
- type Comparison
- type Conjunction
- func (s *Conjunction) Add(expression Expression)
- func (s *Conjunction) AddSlice(expressions []Expression)
- func (s *Conjunction) Get(index int) Expression
- func (s *Conjunction) GetAll() []Expression
- func (s *Conjunction) IndexOf(expressionToFind Expression) int
- func (s *Conjunction) Len() int
- func (s *Conjunction) Remove(expressionToRemove Expression) bool
- func (s *Conjunction) Replace(index int, expression Expression)
- type CopyExtension
- type Create
- type Delete
- type Disjunction
- func (s *Disjunction) Add(expression Expression)
- func (s *Disjunction) AddSlice(expressions []Expression)
- func (s *Disjunction) Get(index int) Expression
- func (s *Disjunction) GetAll() []Expression
- func (s *Disjunction) IndexOf(expressionToFind Expression) int
- func (s *Disjunction) Len() int
- func (s *Disjunction) Remove(expressionToRemove Expression) bool
- func (s *Disjunction) Replace(index int, expression Expression)
- type ExclusiveDisjunction
- func (s *ExclusiveDisjunction) Add(expression Expression)
- func (s *ExclusiveDisjunction) AddSlice(expressions []Expression)
- func (s *ExclusiveDisjunction) Get(index int) Expression
- func (s *ExclusiveDisjunction) GetAll() []Expression
- func (s *ExclusiveDisjunction) IndexOf(expressionToFind Expression) int
- func (s *ExclusiveDisjunction) Len() int
- func (s *ExclusiveDisjunction) Remove(expressionToRemove Expression) bool
- func (s *ExclusiveDisjunction) Replace(index int, expression Expression)
- type Expression
- type ExpressionList
- type Fallible
- type FilterExpression
- type FunctionInvocation
- type IDInCollection
- type KindMatcher
- type Limit
- type ListLiteral
- type Literal
- type MapItem
- type MapLiteral
- type Match
- type Merge
- type MergeAction
- type MultiPartQuery
- type MultiPartQueryPart
- type Negation
- type NodePattern
- type Operator
- type Order
- type Parameter
- type Parenthetical
- type PartialArithmeticExpression
- type PartialComparison
- type PatternElement
- type PatternPart
- type PatternPredicate
- type PatternRange
- type Projection
- type ProjectionItem
- type Properties
- type PropertyLookup
- type Quantifier
- type QuantifierType
- type RangeQuantifier
- type ReadingClause
- type RegularQuery
- type RelationshipPattern
- type Remove
- type RemoveItem
- type Return
- type Set
- type SetItem
- type SinglePartQuery
- func (s *SinglePartQuery) AddError(err error)
- func (s *SinglePartQuery) AddReadingClause(clause *ReadingClause)
- func (s *SinglePartQuery) AddUpdatingClause(clause *UpdatingClause)
- func (s *SinglePartQuery) Errors() []error
- func (s *SinglePartQuery) NewMatch(optional bool) *Match
- func (s *SinglePartQuery) NewProjection(distinct bool) *Projection
- func (s *SinglePartQuery) NewReadingClause() *ReadingClause
- type SingleQuery
- type Skip
- type SortItem
- type SortOrder
- type SyntaxNode
- type UnaryAddOrSubtractExpression
- type Unwind
- type UpdatingClause
- type Variable
- type Where
- func (s *Where) Add(expression Expression)
- func (s *Where) AddSlice(expressions []Expression)
- func (s *Where) Get(index int) Expression
- func (s *Where) GetAll() []Expression
- func (s *Where) IndexOf(expressionToFind Expression) int
- func (s *Where) Len() int
- func (s *Where) Remove(expressionToRemove Expression) bool
- func (s *Where) Replace(index int, expression Expression)
- type With
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" StringSplitToArrayFunction = "split" ToStringFunction = "tostring" ToIntegerFunction = "toint" ListSizeFunction = "size" 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 (
GreedyRangeQuantifier = NewRangeQuantifier("*")
)
Functions ¶
func Copy ¶
func Copy[T any](value T, extensions ...CopyExtension[T]) T
func NewRegularQueryWithSingleQuery ¶ added in v0.1.4
func NewRegularQueryWithSingleQuery() (*RegularQuery, *SinglePartQuery)
func WithErrors ¶
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) Remove ¶
func (s *Conjunction) Remove(expressionToRemove Expression) bool
func (*Conjunction) Replace ¶
func (s *Conjunction) Replace(index int, expression Expression)
type CopyExtension ¶
type Create ¶
type Create struct {
Unique bool
Pattern []*PatternPart
// contains filtered or unexported fields
}
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) 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) 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 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) 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
}
func NewKindMatcher ¶
func NewKindMatcher(reference Expression, kinds graph.Kinds) *KindMatcher
type Limit ¶
type Limit struct {
Value Expression
}
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 MapItem ¶
type MapItem struct {
Key string
Value Expression
}
type MapLiteral ¶
type MapLiteral map[string]Expression
func NewMapLiteral ¶
func NewMapLiteral() MapLiteral
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 (*Match) FirstRelationshipPattern ¶
func (s *Match) FirstRelationshipPattern() *RelationshipPattern
func (*Match) NewPatternPart ¶ added in v0.1.4
func (s *Match) NewPatternPart() *PatternPart
type Merge ¶
type Merge struct {
PatternPart *PatternPart
MergeActions []*MergeAction
}
type MergeAction ¶
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 Parameter ¶
func NewParameter ¶
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
}
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 ¶
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 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 ¶
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 (*Return) NewProjection ¶ added in v0.1.4
func (s *Return) NewProjection(distinct bool) *Projection
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) AddReadingClause ¶
func (s *SinglePartQuery) AddReadingClause(clause *ReadingClause)
func (*SinglePartQuery) AddUpdatingClause ¶
func (s *SinglePartQuery) AddUpdatingClause(clause *UpdatingClause)
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 SortItem ¶
type SortItem struct {
Ascending bool
Expression Expression
}
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
}
type UpdatingClause ¶
type UpdatingClause struct {
Clause Expression
// contains filtered or unexported fields
}
func NewUpdatingClause ¶
type Variable ¶
type Variable struct {
Symbol string
}
func NewVariable ¶
func NewVariable() *Variable
func NewVariableWithSymbol ¶
type Where ¶
type Where struct {
// contains filtered or unexported fields
}
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) Remove ¶
func (s *Where) Remove(expressionToRemove Expression) bool
func (*Where) Replace ¶
func (s *Where) Replace(index int, expression Expression)
Click to show internal directories.
Click to hide internal directories.