Documentation
¶
Index ¶
- type Condition
- type Executor
- type ExpandRelationship
- type FilterWhere
- type Lexer
- type MatchClause
- type NodePattern
- type Parser
- type Pattern
- type PatternElement
- type Plan
- type PlanStep
- type Query
- type RelPattern
- type Result
- type ReturnClause
- type ReturnItem
- type ScanNodes
- type Token
- type TokenType
- type WhereClause
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct {
Variable string // "f"
Property string // "name"
Operator string // "=", "=~", "CONTAINS", "STARTS WITH", ">", "<", ">=", "<="
Value string // the comparison value
}
Condition is a single property comparison.
type ExpandRelationship ¶
type ExpandRelationship struct {
FromVar string // source variable (already bound)
ToVar string // target variable (to bind)
RelVar string // optional relationship variable (to bind edge)
ToLabel string // optional label filter on target
ToProps map[string]string
EdgeTypes []string // required edge types
Direction string // "outbound", "inbound", "any"
MinHops int
MaxHops int
}
ExpandRelationship follows edges from bound nodes to match target nodes.
type FilterWhere ¶
FilterWhere applies WHERE conditions to the bindings.
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
Lexer tokenizes a Cypher query string.
type MatchClause ¶
type MatchClause struct {
Pattern *Pattern
}
MatchClause holds the MATCH pattern.
type NodePattern ¶
type NodePattern struct {
Variable string // e.g. "f"
Label string // e.g. "Function" (optional)
Props map[string]string // inline property filters (optional)
}
NodePattern matches a graph node with optional label and inline properties.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser converts a token stream into an AST.
type Pattern ¶
type Pattern struct {
Elements []PatternElement
}
Pattern is a sequence of alternating nodes and relationships.
type PatternElement ¶
type PatternElement interface {
// contains filtered or unexported methods
}
PatternElement is either a NodePattern or a RelPattern.
type Plan ¶
type Plan struct {
Steps []PlanStep
ReturnSpec *ReturnClause
}
Plan represents an execution plan for a parsed Cypher query.
type PlanStep ¶
type PlanStep interface {
// contains filtered or unexported methods
}
PlanStep is a single step in the execution plan.
type Query ¶
type Query struct {
Match *MatchClause
Where *WhereClause
Return *ReturnClause
}
Query represents a parsed Cypher query.
type RelPattern ¶
type RelPattern struct {
Variable string // (optional)
Types []string // relationship types, e.g. ["CALLS", "HTTP_CALLS"]
Direction string // "outbound", "inbound", "any"
MinHops int // for variable-length, default 1
MaxHops int // for variable-length, default 1 (0 means unbounded)
}
RelPattern matches a graph relationship with optional types, direction, and hops.
type ReturnClause ¶
type ReturnClause struct {
Items []ReturnItem
OrderBy string // "f.name" (optional)
OrderDir string // "ASC" or "DESC"
Limit int // 0 means no limit
Distinct bool
}
ReturnClause specifies which data to return from the query.
type ReturnItem ¶
type ReturnItem struct {
Variable string // "f"
Property string // "name" (empty = return whole node)
Alias string // "AS call_count" (optional)
Func string // "COUNT" (optional aggregation)
}
ReturnItem is a single item in the RETURN clause.
type ScanNodes ¶
type ScanNodes struct {
Variable string
Label string
Props map[string]string // inline property filters
}
ScanNodes finds nodes matching label and/or inline property filters.
type Token ¶
Token is a single lexer token.
type TokenType ¶
type TokenType int
TokenType classifies a lexer token.
const ( // Keywords TokMatch TokenType = iota // MATCH TokWhere // WHERE TokReturn // RETURN TokOrder // ORDER TokBy // BY TokLimit // LIMIT TokAnd // AND TokOr // OR TokAs // AS TokDistinct // DISTINCT TokCount // COUNT TokContains // CONTAINS TokStarts // STARTS TokWith // WITH TokNot // NOT TokAsc // ASC TokDesc // DESC // Symbols TokLParen // ( TokRParen // ) TokLBracket // [ TokRBracket // ] TokDash // - TokGT // > TokLT // < TokColon // : TokDot // . TokLBrace // { TokRBrace // } TokStar // * TokComma // , TokEQ // = TokRegex // =~ TokGTE // >= TokLTE // <= TokPipe // | TokDotDot // .. // Literals TokIdent // identifier TokString // "..." or '...' TokNumber // integer TokEOF // end of input )
type WhereClause ¶
WhereClause holds filter conditions joined by AND/OR.