internal

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExpressionAlreadyBound error = errors.New("expression already bound to different value")
	ErrAliasAlreadyBound      error = errors.New("alias already bound to expression")
)

Functions

func ConfigureMerge

func ConfigureMerge(o *Merge, configurer MergeOption)

func ConfigureProjectionBody

func ConfigureProjectionBody(p *ProjectionBody, configurer ProjectionBodyOption)

func ConfigureVariable

func ConfigureVariable(v *Variable, configurer VariableOption)

func ConfigureWhere

func ConfigureWhere(w *Where, configurer WhereOption)

func ExtractConcreteNodeLabels added in v1.0.2

func ExtractConcreteNodeLabels(i any) []string

func ExtractNodeLabels

func ExtractNodeLabels(i any) []string

func ExtractRelationshipType

func ExtractRelationshipType(relationship any) string

Types

type Abstract

type Abstract struct{}

func (*Abstract) IsAbstract

func (*Abstract) IsAbstract()

type CompiledCypher

type CompiledCypher struct {
	Cypher     string
	Parameters map[string]any
	Bindings   map[string]reflect.Value
	IsWrite    bool
}

type Condition

type Condition struct {
	Xor   []*Condition
	Or    []*Condition
	And   []*Condition
	Path  Pattern
	Key   any
	Op    string
	Value any
	Not   bool
}

func (*Condition) Condition

func (c *Condition) Condition() *Condition

type Configurer

type Configurer struct {
	Merge          func(*Merge)
	Variable       func(*Variable)
	ProjectionBody func(*ProjectionBody)
	Where          func(*Where)
}

type CypherClient

type CypherClient struct {
	*CypherReader
	*CypherUpdater[*CypherQuerier]
	// contains filtered or unexported fields
}

func NewCypherClient

func NewCypherClient() *CypherClient

func (CypherClient) Bindings

func (c CypherClient) Bindings() map[string]reflect.Value

func (CypherClient) Params

func (c CypherClient) Params() map[string]any

func (*CypherClient) Union

func (c *CypherClient) Union(unions ...func(c *CypherClient) *CypherRunner) *CypherQuerier

func (*CypherClient) UnionAll

func (c *CypherClient) UnionAll(unions ...func(c *CypherClient) *CypherRunner) *CypherQuerier

func (*CypherClient) Use

func (c *CypherClient) Use(graphExpr string) *CypherQuerier

type CypherPath

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

func (*CypherPath) Condition

func (c *CypherPath) Condition() *Condition

func (*CypherPath) From

func (c *CypherPath) From(relationshipMatch, nodeMatch any) Pattern

func (*CypherPath) Related

func (c *CypherPath) Related(relationshipMatch, nodeMatch any) Pattern

func (*CypherPath) To

func (c *CypherPath) To(relationshipMatch, nodeMatch any) Pattern

type CypherPattern

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

type CypherQuerier

type CypherQuerier struct {
	*CypherReader
	*CypherRunner
	*CypherUpdater[*CypherQuerier]
	// contains filtered or unexported fields
}

func (CypherQuerier) Bindings

func (c CypherQuerier) Bindings() map[string]reflect.Value

func (CypherQuerier) Params

func (c CypherQuerier) Params() map[string]any

func (*CypherQuerier) Where

func (c *CypherQuerier) Where(opts ...WhereOption) *CypherQuerier

type CypherReader

type CypherReader struct {
	*CypherRunner
	Parent *Scope
	// contains filtered or unexported fields
}

func (CypherReader) Bindings

func (c CypherReader) Bindings() map[string]reflect.Value

func (*CypherReader) Call

func (c *CypherReader) Call(procedure string) *CypherYielder

func (*CypherReader) Cypher

func (c *CypherReader) Cypher(query string) *CypherQuerier

func (*CypherReader) Eval

func (c *CypherReader) Eval(expression func(*Scope, *strings.Builder)) *CypherQuerier

func (*CypherReader) Match

func (c *CypherReader) Match(patterns Patterns) *CypherQuerier

func (*CypherReader) OptionalMatch

func (c *CypherReader) OptionalMatch(patterns Patterns) *CypherQuerier

func (CypherReader) Params

func (c CypherReader) Params() map[string]any

func (*CypherReader) Return

func (c *CypherReader) Return(identifiers ...any) *CypherRunner

func (*CypherReader) Show

func (c *CypherReader) Show(command string) *CypherYielder

func (*CypherReader) Subquery

func (c *CypherReader) Subquery(subquery func(c *CypherClient) *CypherRunner) *CypherQuerier

func (*CypherReader) Unwind

func (c *CypherReader) Unwind(identifier any, as string) *CypherQuerier

func (*CypherReader) With

func (c *CypherReader) With(identifiers ...any) *CypherQuerier

type CypherRunner

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

func (CypherRunner) Bindings

func (c CypherRunner) Bindings() map[string]reflect.Value

func (*CypherRunner) Compile

func (c *CypherRunner) Compile() (*CompiledCypher, error)

func (*CypherRunner) CompileWithParams

func (c *CypherRunner) CompileWithParams(params map[string]any) (*CompiledCypher, error)

func (CypherRunner) Params

func (c CypherRunner) Params() map[string]any

func (*CypherRunner) Print

func (c *CypherRunner) Print()

type CypherUpdater

type CypherUpdater[To any] struct {
	*CypherRunner
	To func(*cypher) To
	// contains filtered or unexported fields
}

func (CypherUpdater) Bindings

func (c CypherUpdater) Bindings() map[string]reflect.Value

func (*CypherUpdater[To]) Create

func (c *CypherUpdater[To]) Create(pattern Patterns) To

func (*CypherUpdater[To]) Delete

func (c *CypherUpdater[To]) Delete(identifiers ...any) To

func (*CypherUpdater[To]) DetachDelete

func (c *CypherUpdater[To]) DetachDelete(propIdentifiers ...any) To

func (*CypherUpdater[To]) ForEach

func (c *CypherUpdater[To]) ForEach(identifier, elementsExpr any, do func(c *CypherUpdater[any])) To

func (*CypherUpdater[To]) Merge

func (c *CypherUpdater[To]) Merge(pattern Pattern, opts ...MergeOption) To

func (CypherUpdater) Params

func (c CypherUpdater) Params() map[string]any

func (*CypherUpdater[To]) Remove

func (c *CypherUpdater[To]) Remove(items ...RemoveItem) To

func (*CypherUpdater[To]) Set

func (c *CypherUpdater[To]) Set(items ...SetItem) To

type CypherYielder

type CypherYielder struct {
	*CypherQuerier
	// contains filtered or unexported fields
}

func (CypherYielder) Bindings

func (c CypherYielder) Bindings() map[string]reflect.Value

func (CypherYielder) Params

func (c CypherYielder) Params() map[string]any

func (*CypherYielder) Yield

func (c *CypherYielder) Yield(identifiers ...any) *CypherQuerier

type Expr

type Expr string

func (Expr) Condition

func (e Expr) Condition() *Condition

type IAbstract

type IAbstract interface {
	INode
	IsAbstract()
	Implementers() []IAbstract
}

type ICondition

type ICondition interface {
	WhereOption
	Condition() *Condition
}

type IDSetter

type IDSetter interface {
	SetID(id any)
	GenerateID()
}

type INode

type INode interface {
	IsNode()
	GetID() string
}

type IRelationship

type IRelationship interface {
	IsRelationship()
}

type Label added in v1.0.2

type Label struct{}

type Merge

type Merge struct {
	OnCreate []SetItem
	OnMatch  []SetItem
}

type MergeOption

type MergeOption interface {
	// contains filtered or unexported methods
}

type Node

type Node struct {
	ID string `json:"id"`
}

func (*Node) GenerateID

func (n *Node) GenerateID()

func (Node) GetID

func (n Node) GetID() string

func (Node) IsNode

func (Node) IsNode()

func (*Node) SetID

func (n *Node) SetID(id any)

type Param

type Param struct {
	Name  string
	Value *any
}

type Pattern

type Pattern interface {
	Patterns
	ICondition

	Related(relationshipMatch, nodeMatch any) Pattern
	From(relationshipMatch, nodeMatch any) Pattern
	To(relationshipMatch, nodeMatch any) Pattern
	// contains filtered or unexported methods
}

func NewNode

func NewNode(match any) Pattern

func NewPath

func NewPath(path Pattern, name string) Pattern

type Patterns

type Patterns interface {
	// contains filtered or unexported methods
}

func Paths

func Paths(paths ...Pattern) Patterns

type ProjectionBody

type ProjectionBody struct {
	Identifier any
	Distinct   bool
	// contains filtered or unexported fields
}

type ProjectionBodyOption

type ProjectionBodyOption interface {
	// contains filtered or unexported methods
}

type Props

type Props map[any]any

type Relationship

type Relationship struct{}

func (Relationship) IsRelationship

func (Relationship) IsRelationship()

type RemoveItem

type RemoveItem struct {
	PropIdentifier any
	Labels         []string
}

type Scope

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

func (*Scope) AddError

func (s *Scope) AddError(err error)

func (*Scope) Error

func (s *Scope) Error() error

func (*Scope) MergeChildScope

func (s *Scope) MergeChildScope(child *Scope)

func (*Scope) Name

func (s *Scope) Name(identifier any) string

type SetItem

type SetItem struct {
	PropIdentifier any
	ValIdentifier  any
	Merge          bool
	Labels         []string
}

type Variable

type Variable struct {
	Identifier any
	Bind       any
	Name       string
	// If both name and expr are provided, name is used as an alias
	Expr      Expr
	Where     *Where
	Props     Props
	PropsExpr Expr
	Pattern   Expr
	VarLength Expr
}

type VariableOption

type VariableOption interface {
	// contains filtered or unexported methods
}

type Where

type Where struct {
	Identifier any
	Expr       string
	Conds      []*Condition
}

type WhereOption

type WhereOption interface {
	// contains filtered or unexported methods
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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