v2

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 12 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var Identifiers = runtimeIdentifiers{
	// contains filtered or unexported fields
}

Functions

func AddKind

func AddKind(reference any, kind graph.Kind) *cypher.SetItem

func AddKinds

func AddKinds(reference any, kinds graph.Kinds) *cypher.SetItem

func After

func After(reference any, value any) cypher.Expression

func And

func And(operands ...cypher.SyntaxNode) cypher.SyntaxNode

func As

func As(expression any, alias string) *cypher.ProjectionItem

func Asc

func Asc(expression any) *cypher.SortItem

func Before

func Before(reference any, value time.Time) cypher.Expression

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 DeleteProperties(reference any, propertyNames ...string) *cypher.Remove

func DeleteProperty

func DeleteProperty(reference any) *cypher.RemoveItem

func Desc

func Desc(expression any) *cypher.SortItem

func EndID

func EndID() *cypher.FunctionInvocation

func EndNodePattern

func EndNodePattern(kinds graph.Kinds, properties cypher.Expression) *cypher.NodePattern

func Equals

func Equals(reference any, value any) cypher.Expression

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 In

func In(reference any, value any) cypher.Expression

func InIDs

func InIDs(reference any, ids ...graph.ID) cypher.Expression

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 Kind

func Kind(reference any, kinds ...graph.Kind) *cypher.KindMatcher

func KindIn

func KindIn(reference any, kinds ...graph.Kind) *cypher.KindMatcher

func KindsOf

func KindsOf(reference any) *cypher.FunctionInvocation

func LessThan

func LessThan(reference any, value any) cypher.Expression

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 Literal

func Literal(value any) *cypher.Literal

func NamedParameter

func NamedParameter(symbol string, value any) *cypher.Parameter

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 Order

func Order(expression any, direction SortDirection) *cypher.SortItem

func Parameter

func Parameter(value any) *cypher.Parameter

func RelationshipID

func RelationshipID() *cypher.FunctionInvocation

func RelationshipPattern

func RelationshipPattern(kind graph.Kind, properties cypher.Expression, direction graph.Direction) *cypher.RelationshipPattern

func SetProperties

func SetProperties(reference any, properties map[string]any) *cypher.Set

func SetProperty

func SetProperty(reference any, value any) *cypher.SetItem

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

func Variable

func Variable(name string) *cypher.Variable

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 KindsContinuation interface {
	Has(kind graph.Kind) cypher.Expression
	HasOneOf(kinds graph.Kinds) cypher.Expression
	Add(kinds graph.Kinds) *cypher.SetItem
	Remove(kinds graph.Kinds) *cypher.RemoveItem
}

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 NewScope

func NewScope(path, node, start, relationship, end string) 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

Jump to

Keyboard shortcuts

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