Documentation
¶
Overview ¶
Package v2 contains the experimental fluent Cypher query builder.
It is intentionally isolated from the stable query package so callers can opt in without pulling the current graph query APIs through a compatibility layer.
Index ¶
- Variables
- func AddKind(reference any, kind graph.Kind) *cypher.SetItem
- func AddKinds(reference any, kinds graph.Kinds) *cypher.SetItem
- func After(reference any, value any) cypher.Expression
- func And(operands ...cypher.SyntaxNode) cypher.SyntaxNode
- func As(expression any, alias string) *cypher.ProjectionItem
- func Asc(expression any) *cypher.SortItem
- func Before(reference any, value time.Time) cypher.Expression
- func BeforeGraphQuery(reference any, other any) cypher.Expression
- func CaseInsensitiveStringContains(reference any, value string) cypher.Expression
- func CaseInsensitiveStringEndsWith(reference any, value string) cypher.Expression
- func CaseInsensitiveStringStartsWith(reference any, value string) cypher.Expression
- func Count(reference any) *cypher.FunctionInvocation
- func CountDistinct(reference any) *cypher.FunctionInvocation
- func DeleteKind(reference any, kind graph.Kind) *cypher.RemoveItem
- func DeleteKinds(reference any, kinds graph.Kinds) *cypher.RemoveItem
- func DeleteProperties(reference any, propertyNames ...string) *cypher.Remove
- func DeleteProperty(reference any) *cypher.RemoveItem
- func Desc(expression any) *cypher.SortItem
- func EndID() *cypher.FunctionInvocation
- func EndNodePattern(kinds graph.Kinds, properties cypher.Expression) *cypher.NodePattern
- func Equals(reference any, value any) cypher.Expression
- func Exists(reference any) cypher.Expression
- func GreaterThan(reference any, value any) cypher.Expression
- func GreaterThanOrEqualTo(reference any, value any) cypher.Expression
- func GreaterThanOrEquals(reference any, value any) cypher.Expression
- func HasRelationships(reference any) *cypher.PatternPredicate
- func Identity(reference any) *cypher.FunctionInvocation
- func In(reference any, value any) cypher.Expression
- func InIDs(reference any, ids ...graph.ID) cypher.Expression
- func InInverted(reference any, value any) cypher.Expression
- func IsNotNull(reference any) cypher.Expression
- func IsNull(reference any) cypher.Expression
- func Kind(reference any, kinds ...graph.Kind) *cypher.KindMatcher
- func KindIn(reference any, kinds ...graph.Kind) *cypher.KindMatcher
- func KindsOf(reference any) *cypher.FunctionInvocation
- func LessThan(reference any, value any) cypher.Expression
- func LessThanGraphQuery(reference any, other any) cypher.Expression
- func LessThanOrEqualTo(reference any, value any) cypher.Expression
- func LessThanOrEquals(reference any, value any) cypher.Expression
- func Literal(value any) *cypher.Literal
- func NamedParameter(symbol string, value any) *cypher.Parameter
- func NodeID() *cypher.FunctionInvocation
- func NodePattern(kinds graph.Kinds, properties cypher.Expression) *cypher.NodePattern
- func Not(operand cypher.Expression) cypher.Expression
- func Or(operands ...cypher.SyntaxNode) cypher.SyntaxNode
- func Order(expression any, direction SortDirection) *cypher.SortItem
- func Parameter(value any) *cypher.Parameter
- func RelationshipID() *cypher.FunctionInvocation
- func RelationshipPattern(kind graph.Kind, properties cypher.Expression, direction graph.Direction) *cypher.RelationshipPattern
- func SetProperties(reference any, properties map[string]any) *cypher.Set
- func SetProperty(reference any, value any) *cypher.SetItem
- func Size(expression any) *cypher.FunctionInvocation
- func StartID() *cypher.FunctionInvocation
- func StartNodePattern(kinds graph.Kinds, properties cypher.Expression) *cypher.NodePattern
- func StringContains(reference any, value string) cypher.Expression
- func StringEndsWith(reference any, value string) cypher.Expression
- func StringStartsWith(reference any, value string) cypher.Expression
- func Variable(name string) *cypher.Variable
- type Comparable
- type EntityContinuation
- type IdentityContinuation
- type KindContinuation
- type KindsContinuation
- type NodeContinuation
- type PathContinuation
- type PreparedQuery
- type PropertyContinuation
- type QualifiedExpression
- type QueryBuilder
- type RelationshipContinuation
- type Scope
- type SortDirection
- type TraversalDepth
Constants ¶
This section is empty.
Variables ¶
View Source
var Identifiers = runtimeIdentifiers{ // contains filtered or unexported fields }
Functions ¶
func And ¶
func And(operands ...cypher.SyntaxNode) cypher.SyntaxNode
func BeforeGraphQuery ¶
func BeforeGraphQuery(reference any, other any) cypher.Expression
func CaseInsensitiveStringContains ¶
func CaseInsensitiveStringContains(reference any, value string) cypher.Expression
func CaseInsensitiveStringEndsWith ¶
func CaseInsensitiveStringEndsWith(reference any, value string) cypher.Expression
func CaseInsensitiveStringStartsWith ¶
func CaseInsensitiveStringStartsWith(reference any, value string) cypher.Expression
func Count ¶
func Count(reference any) *cypher.FunctionInvocation
func CountDistinct ¶
func CountDistinct(reference any) *cypher.FunctionInvocation
func DeleteKind ¶
func DeleteKind(reference any, kind graph.Kind) *cypher.RemoveItem
func DeleteKinds ¶
func DeleteKinds(reference any, kinds graph.Kinds) *cypher.RemoveItem
func DeleteProperties ¶
func DeleteProperty ¶
func DeleteProperty(reference any) *cypher.RemoveItem
func EndID ¶
func EndID() *cypher.FunctionInvocation
func EndNodePattern ¶
func EndNodePattern(kinds graph.Kinds, properties cypher.Expression) *cypher.NodePattern
func Exists ¶
func Exists(reference any) cypher.Expression
func GreaterThan ¶
func GreaterThan(reference any, value any) cypher.Expression
func GreaterThanOrEqualTo ¶
func GreaterThanOrEqualTo(reference any, value any) cypher.Expression
func GreaterThanOrEquals ¶
func GreaterThanOrEquals(reference any, value any) cypher.Expression
func HasRelationships ¶
func HasRelationships(reference any) *cypher.PatternPredicate
func Identity ¶
func Identity(reference any) *cypher.FunctionInvocation
func InInverted ¶
func InInverted(reference any, value any) cypher.Expression
func IsNotNull ¶
func IsNotNull(reference any) cypher.Expression
func IsNull ¶
func IsNull(reference any) cypher.Expression
func KindsOf ¶
func KindsOf(reference any) *cypher.FunctionInvocation
func LessThanGraphQuery ¶
func LessThanGraphQuery(reference any, other any) cypher.Expression
func LessThanOrEqualTo ¶
func LessThanOrEqualTo(reference any, value any) cypher.Expression
func LessThanOrEquals ¶
func LessThanOrEquals(reference any, value any) cypher.Expression
func NodeID ¶
func NodeID() *cypher.FunctionInvocation
func NodePattern ¶
func NodePattern(kinds graph.Kinds, properties cypher.Expression) *cypher.NodePattern
func Not ¶
func Not(operand cypher.Expression) cypher.Expression
func Or ¶
func Or(operands ...cypher.SyntaxNode) cypher.SyntaxNode
func RelationshipID ¶
func RelationshipID() *cypher.FunctionInvocation
func RelationshipPattern ¶
func RelationshipPattern(kind graph.Kind, properties cypher.Expression, direction graph.Direction) *cypher.RelationshipPattern
func Size ¶
func Size(expression any) *cypher.FunctionInvocation
func StartID ¶
func StartID() *cypher.FunctionInvocation
func StartNodePattern ¶
func StartNodePattern(kinds graph.Kinds, properties cypher.Expression) *cypher.NodePattern
func StringContains ¶
func StringContains(reference any, value string) cypher.Expression
func StringEndsWith ¶
func StringEndsWith(reference any, value string) cypher.Expression
func StringStartsWith ¶
func StringStartsWith(reference any, value string) cypher.Expression
Types ¶
type Comparable ¶
type Comparable interface {
In(value any) cypher.Expression
Contains(value any) cypher.Expression
StartsWith(value any) cypher.Expression
EndsWith(value any) cypher.Expression
Equals(value any) cypher.Expression
GreaterThan(value any) cypher.Expression
GreaterThanOrEqualTo(value any) cypher.Expression
LessThan(value any) cypher.Expression
LessThanOrEqualTo(value any) cypher.Expression
IsNull() cypher.Expression
IsNotNull() cypher.Expression
}
type EntityContinuation ¶
type EntityContinuation interface {
QualifiedExpression
Count() cypher.Expression
ID() IdentityContinuation
Property(name string) PropertyContinuation
}
type IdentityContinuation ¶
type IdentityContinuation interface {
QualifiedExpression
Comparable
}
type KindContinuation ¶
type KindContinuation interface {
Is(kind graph.Kind) cypher.Expression
IsOneOf(kinds graph.Kinds) cypher.Expression
}
type KindsContinuation ¶
type NodeContinuation ¶
type NodeContinuation interface {
EntityContinuation
NodePattern(kinds graph.Kinds, properties cypher.Expression) cypher.Expression
Kinds() KindsContinuation
SetProperties(properties map[string]any) *cypher.Set
RemoveProperties(properties []string) *cypher.Remove
}
func End ¶
func End() NodeContinuation
func Node ¶
func Node() NodeContinuation
func Start ¶
func Start() NodeContinuation
type PathContinuation ¶
type PathContinuation interface {
QualifiedExpression
Count() cypher.Expression
}
func Path ¶
func Path() PathContinuation
type PreparedQuery ¶
type PreparedQuery struct {
Query *cypher.RegularQuery
Parameters map[string]any
}
type PropertyContinuation ¶
type PropertyContinuation interface {
QualifiedExpression
Comparable
Set(value any) *cypher.SetItem
Remove() *cypher.RemoveItem
}
type QualifiedExpression ¶
type QualifiedExpression interface {
// contains filtered or unexported methods
}
type QueryBuilder ¶
type QueryBuilder interface {
Where(constraints ...cypher.SyntaxNode) QueryBuilder
OrderBy(sortItems ...any) QueryBuilder
Skip(offset int) QueryBuilder
// Limit accepts zero, which renders LIMIT 0 and returns an empty result set.
Limit(limit int) QueryBuilder
Return(projections ...any) QueryBuilder
ReturnDistinct(projections ...any) QueryBuilder
Update(updatingClauses ...any) QueryBuilder
Create(creationClauses ...any) QueryBuilder
Delete(expressions ...any) QueryBuilder
WithShortestPaths() QueryBuilder
WithAllShortestPaths() QueryBuilder
WithTraversalDepth(depth TraversalDepth) QueryBuilder
WithRelationshipDirection(direction graph.Direction) QueryBuilder
Build() (*PreparedQuery, error)
}
func New ¶
func New() QueryBuilder
type RelationshipContinuation ¶
type RelationshipContinuation interface {
EntityContinuation
RelationshipPattern(kind graph.Kind, properties cypher.Expression, direction graph.Direction) cypher.Expression
Kind() KindContinuation
SetProperties(properties map[string]any) *cypher.Set
RemoveProperties(properties []string) *cypher.Remove
}
func Relationship ¶
func Relationship() RelationshipContinuation
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
func DefaultScope ¶
func DefaultScope() Scope
func (Scope) End ¶
func (s Scope) End() NodeContinuation
func (Scope) New ¶
func (s Scope) New() QueryBuilder
func (Scope) Node ¶
func (s Scope) Node() NodeContinuation
func (Scope) Path ¶
func (s Scope) Path() PathContinuation
func (Scope) Relationship ¶
func (s Scope) Relationship() RelationshipContinuation
func (Scope) Start ¶
func (s Scope) Start() NodeContinuation
type SortDirection ¶
type SortDirection int
const ( SortAscending SortDirection = iota SortDescending )
type TraversalDepth ¶
type TraversalDepth struct {
// contains filtered or unexported fields
}
func AnyDepth ¶
func AnyDepth() TraversalDepth
func DepthRange ¶
func DepthRange(min, max int64) TraversalDepth
func ExactDepth ¶
func ExactDepth(depth int64) TraversalDepth
func MaxDepth ¶
func MaxDepth(max int64) TraversalDepth
func MinDepth ¶
func MinDepth(min int64) TraversalDepth
Click to show internal directories.
Click to hide internal directories.