Documentation
¶
Index ¶
- type BinaryExpr
- type Clause
- type CreateClause
- type DeleteClause
- type Direction
- type Executor
- type Expr
- type FuncCall
- type Ident
- type IsNullExpr
- type Lexer
- type ListComprehension
- type ListLiteral
- type Literal
- type MatchClause
- type NodePattern
- type OrderItem
- type Parser
- type PathPattern
- type PatternElement
- type PropertyAccess
- type Query
- type RelPattern
- type Result
- type ReturnClause
- type ReturnItem
- type SetClause
- type SetItem
- type ShortestPathExpr
- type Token
- type TokenType
- type UnaryExpr
- type UnwindClause
- type WhereClause
- type WithClause
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryExpr ¶
type BinaryExpr struct {
Left Expr
Op string // =, <>, <, >, <=, >=, AND, OR, +, -, *, /, %, IN, CONTAINS, STARTS WITH, ENDS WITH
Right Expr
}
BinaryExpr represents a binary operation.
type Clause ¶
type Clause interface {
// contains filtered or unexported methods
}
Clause is implemented by all clause types.
type CreateClause ¶
type CreateClause struct {
Pattern []PathPattern
}
CreateClause represents CREATE.
type DeleteClause ¶
DeleteClause represents DELETE or DETACH DELETE.
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor executes Cypher queries against a graph.
func NewExecutor ¶
NewExecutor creates a new Cypher executor.
type Expr ¶
type Expr interface {
// contains filtered or unexported methods
}
Expr is implemented by all expression types.
type IsNullExpr ¶
IsNullExpr represents expr IS NULL or IS NOT NULL.
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
Lexer tokenizes Cypher input.
type ListComprehension ¶
ListComprehension represents [x IN list | expr] or [x IN list WHERE cond | expr].
type ListLiteral ¶
type ListLiteral struct {
Elements []Expr
}
ListLiteral represents [expr, expr, ...].
type Literal ¶
type Literal struct {
Value any // string, int64, float64, bool, nil
}
Literal represents a literal value.
type MatchClause ¶
type MatchClause struct {
Pattern []PathPattern
Optional bool
}
MatchClause represents MATCH or OPTIONAL MATCH.
type NodePattern ¶
NodePattern represents (var:Label {props}).
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser is a recursive descent parser for Cypher.
type PathPattern ¶
type PathPattern struct {
Variable string // optional named path
Elements []PatternElement
}
PathPattern is a sequence of alternating node and relationship patterns.
type PatternElement ¶
type PatternElement interface {
// contains filtered or unexported methods
}
PatternElement is either a NodePattern or RelPattern.
type PropertyAccess ¶
PropertyAccess represents var.prop.
type RelPattern ¶
type RelPattern struct {
Variable string
Types []string
Direction Direction
MinHops *int
MaxHops *int
}
RelPattern represents -[var:TYPE*min..max]->
type ReturnClause ¶
type ReturnClause struct {
Distinct bool
Items []ReturnItem
OrderBy []OrderItem
Limit *Expr
Skip *Expr
}
ReturnClause represents RETURN.
type ReturnItem ¶
ReturnItem is a single item in RETURN.
type SetItem ¶
type SetItem struct {
Property PropertyAccess
Value Expr
}
SetItem is a single SET assignment.
type ShortestPathExpr ¶
type ShortestPathExpr struct {
Path PathPattern
}
ShortestPathExpr represents shortestPath((a)-[*]-(b)).
type TokenType ¶
type TokenType int
TokenType represents the type of a lexer token.
const ( // Literals TokenIdent TokenType = iota // identifier TokenString // "string" TokenInt // 123 TokenFloat // 1.23 TokenTrue // true TokenFalse // false TokenNull // null // Keywords TokenMatch TokenOptional TokenWhere TokenReturn TokenCreate TokenDelete TokenDetach TokenSet TokenWith TokenAs TokenOrder TokenBy TokenLimit TokenSkipKw TokenAnd TokenOr TokenNot TokenIn TokenContains TokenStarts TokenEnds TokenIs TokenDistinct TokenCount TokenCollect TokenSum TokenAvg TokenMin TokenMax TokenSize TokenShortestPath TokenDesc TokenAsc TokenUnwind // Symbols TokenLParen // ( TokenRParen // ) TokenLBracket // [ TokenRBracket // ] TokenLBrace // { TokenRBrace // } TokenColon // : TokenDot // . TokenComma // , TokenPipe // | TokenStar // * TokenDotDot // .. TokenEq // = TokenNeq // <> TokenLt // < TokenGt // > TokenLte // <= TokenGte // >= TokenPlus // + TokenMinus // - TokenSlash // / TokenPercent // % TokenDash // - (in patterns) TokenArrowR // -> TokenArrowL // <- TokenDashDash // -- TokenEOF )
type UnwindClause ¶
UnwindClause represents UNWIND.
type WithClause ¶
type WithClause struct {
Distinct bool
Items []ReturnItem
Where *WhereClause
OrderBy []OrderItem
Limit *Expr
Skip *Expr
}
WithClause represents WITH.