query

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 8 Imported by: 21

Documentation

Index

Constants

View Source
const (
	PathSymbol      = "p"
	NodeSymbol      = "n"
	EdgeSymbol      = "r"
	EdgeStartSymbol = "s"
	EdgeEndSymbol   = "e"
)

Variables

View Source
var (
	ErrAmbiguousQueryVariables = errors.New("query mixes node and relationship query variables")
)

Functions

func AddKind

func AddKind(reference graph.Criteria, kind graph.Kind) *cypherModel.UpdatingClause

func AddKinds

func AddKinds(reference graph.Criteria, kinds graph.Kinds) *cypherModel.UpdatingClause

func After

func After(reference graph.Criteria, value any) *cypherModel.Comparison

func And

func And(criteria ...graph.Criteria) *cypherModel.Conjunction

func Ascending

func Ascending() cypherModel.SortOrder

func Before

func Before(reference graph.Criteria, value time.Time) *cypherModel.Comparison

func BeforeGraphQuery

func BeforeGraphQuery(reference1, reference2 graph.Criteria) *cypherModel.Comparison

func CaseInsensitiveStringContains

func CaseInsensitiveStringContains(reference graph.Criteria, value string) *cypherModel.Comparison

func CaseInsensitiveStringEndsWith

func CaseInsensitiveStringEndsWith(reference graph.Criteria, value string) *cypherModel.Comparison

func CaseInsensitiveStringStartsWith

func CaseInsensitiveStringStartsWith(reference graph.Criteria, value string) *cypherModel.Comparison

func Count

func Count(reference graph.Criteria) *cypherModel.FunctionInvocation

func CountDistinct

func CountDistinct(reference graph.Criteria) *cypherModel.FunctionInvocation

func Create

func Create(elements ...graph.Criteria) *cypherModel.UpdatingClause

func Delete

func Delete(leaves ...graph.Criteria) *cypherModel.UpdatingClause

func DeleteKind

func DeleteKind(reference graph.Criteria, kind graph.Kind) *cypherModel.UpdatingClause

func DeleteKinds

func DeleteKinds(reference graph.Criteria, kinds graph.Kinds) *cypherModel.UpdatingClause

func DeleteProperties

func DeleteProperties(reference graph.Criteria, propertyNames ...string) *cypherModel.UpdatingClause

func DeleteProperty

func DeleteProperty(reference *cypherModel.PropertyLookup) *cypherModel.UpdatingClause

func Descending

func Descending() cypherModel.SortOrder

func EmptySinglePartQuery

func EmptySinglePartQuery() *cypherModel.RegularQuery

func End

func End() *cypher.Variable

func EndID

func EndID() *cypher.FunctionInvocation

func EndNodePattern

func EndNodePattern(kinds graph.Kinds, properties *cypherModel.Parameter) *cypherModel.NodePattern

func EndProperty

func EndProperty(name string) *cypherModel.PropertyLookup

func Equals

func Equals(reference graph.Criteria, value any) *cypherModel.Comparison

func Exists

func Exists(reference graph.Criteria) *cypherModel.Comparison

func GetFirstReadingClause

func GetFirstReadingClause(query *cypherModel.RegularQuery) *cypherModel.ReadingClause

func GreaterThan

func GreaterThan(reference graph.Criteria, value any) *cypherModel.Comparison

func GreaterThanOrEquals

func GreaterThanOrEquals(reference graph.Criteria, value any) *cypherModel.Comparison

func HasRelationships

func HasRelationships(reference *cypherModel.Variable) *cypherModel.PatternPredicate

func Identity

func Identity(entity cypher.Expression) *cypher.FunctionInvocation

func In

func In(reference graph.Criteria, value any) *cypherModel.Comparison

func InIDs

func InInverted

func InInverted(reference graph.Criteria, value any) *cypherModel.Comparison

func IsNotNull

func IsNotNull(reference graph.Criteria) *cypherModel.Comparison

func IsNull

func IsNull(reference graph.Criteria) *cypherModel.Comparison

func Kind

func Kind(reference graph.Criteria, kinds ...graph.Kind) *cypherModel.KindMatcher

func KindIn

func KindIn(reference graph.Criteria, kinds ...graph.Kind) *cypherModel.KindMatcher

func LessThan

func LessThan(reference graph.Criteria, value any) *cypherModel.Comparison

func LessThanGraphQuery

func LessThanGraphQuery(reference1, reference2 graph.Criteria) *cypherModel.Comparison

func LessThanOrEquals

func LessThanOrEquals(reference graph.Criteria, value any) *cypherModel.Comparison

func Limit

func Limit(limit int) *cypherModel.Limit

func Literal

func Literal(value any) *cypherModel.Literal

func Node

func Node() *cypher.Variable

func NodeID

func NodeID() *cypher.FunctionInvocation

func NodePattern

func NodePattern(kinds graph.Kinds, properties *cypherModel.Parameter) *cypherModel.NodePattern

func NodeProperty

func NodeProperty(name string) *cypherModel.PropertyLookup

func Not

func Not(expression graph.Criteria) *cypherModel.Negation

func Offset

func Offset(offset int) *cypherModel.Skip

func Or

func Or(criteria ...graph.Criteria) *cypherModel.Parenthetical

func Order

func Order(reference, direction graph.Criteria) *cypherModel.SortItem

func OrderBy

func OrderBy(leaves ...graph.Criteria) *cypherModel.Order

func Parameter

func Parameter(value any) *cypherModel.Parameter

func Path

func Path() *cypher.Variable

func Property

func Property(qualifier graph.Criteria, name string) *cypherModel.PropertyLookup

func Relationship

func Relationship() *cypher.Variable

func RelationshipID

func RelationshipID() *cypher.FunctionInvocation

func RelationshipPattern

func RelationshipPattern(kind graph.Kind, properties *cypherModel.Parameter, direction graph.Direction) *cypherModel.RelationshipPattern

func RelationshipProperty

func RelationshipProperty(name string) *cypherModel.PropertyLookup

func Returning

func Returning(elements ...graph.Criteria) *cypherModel.Return

func ReturningDistinct

func ReturningDistinct(elements ...graph.Criteria) *cypherModel.Return

func SetProperties

func SetProperties(reference graph.Criteria, properties map[string]any) *cypherModel.UpdatingClause

func SetProperty

func SetProperty(reference graph.Criteria, value any) *cypherModel.UpdatingClause

func SinglePartQuery

func SinglePartQuery(expressions ...graph.Criteria) *cypherModel.RegularQuery

func Size

func Size(expression graph.Criteria) *cypherModel.FunctionInvocation

func Start

func Start() *cypher.Variable

func StartID

func StartID() *cypher.FunctionInvocation

func StartNodePattern

func StartNodePattern(kinds graph.Kinds, properties *cypherModel.Parameter) *cypherModel.NodePattern

func StartProperty

func StartProperty(name string) *cypherModel.PropertyLookup

func StringContains

func StringContains(reference graph.Criteria, value string) *cypherModel.Comparison

func StringEndsWith

func StringEndsWith(reference graph.Criteria, value string) *cypherModel.Comparison

func StringStartsWith

func StringStartsWith(reference graph.Criteria, value string) *cypherModel.Comparison

func Update

func Updatef

func Updatef(provider graph.CriteriaProvider) []*cypherModel.UpdatingClause

func Variable

func Variable(name string) *cypher.Variable

func Where

func Where(expression graph.Criteria) *cypherModel.Where

func Xor

Types

type Builder

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

func NewBuilder

func NewBuilder(cache *Cache) *Builder

func NewBuilderWithCriteria

func NewBuilderWithCriteria(criteria ...graph.Criteria) *Builder

func (*Builder) Apply

func (s *Builder) Apply(criteria ...graph.Criteria)

func (*Builder) Build

func (s *Builder) Build(allShortestPaths bool) (*cypher.RegularQuery, error)

func (*Builder) RegularQuery

func (s *Builder) RegularQuery() *cypher.RegularQuery

type Cache

type Cache struct {
}

type ParameterRewriter

type ParameterRewriter struct {
	walk.Visitor[cypher.SyntaxNode]

	Parameters map[string]any
	// contains filtered or unexported fields
}

func NewParameterRewriter

func NewParameterRewriter() *ParameterRewriter

func (*ParameterRewriter) Enter

func (s *ParameterRewriter) Enter(node cypher.SyntaxNode)

type SortDirection

type SortDirection string
const SortDirectionAscending SortDirection = "asc"
const SortDirectionDescending SortDirection = "desc"

type SortItem

type SortItem struct {
	SortCriteria graph.Criteria
	Direction    SortDirection
}

type SortItems

type SortItems []SortItem

func (SortItems) FormatCypherOrder

func (s SortItems) FormatCypherOrder() *cypher.Order

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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