Documentation
¶
Overview ¶
Package cypher provides Cypher query parsing and execution capabilities for gograph.
Index ¶
- func Parse(input string) (*ast.Query, error)
- type Attribute
- type Executor
- func (e *Executor) Execute(ctx context.Context, query string, params map[string]interface{}) (Result, error)
- func (e *Executor) ExecuteAST(ctx context.Context, query *ast.Query, params map[string]interface{}) (Result, error)
- func (e *Executor) ExecuteWithTx(t *tx.Transaction, query *ast.Query, params map[string]interface{}) (Result, error)
- type Logger
- type Meter
- type Observability
- type ObservabilityOption
- type Parser
- type Result
- type Span
- type SpanOption
- type Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Executor ¶
type Executor struct {
Store *storage.DB
Index *graph.Index
// contains filtered or unexported fields
}
func NewExecutor ¶
func (*Executor) ExecuteAST ¶ added in v0.2.0
func (*Executor) ExecuteWithTx ¶
type Logger ¶
type Logger interface {
Debug(msg string, args ...any)
Info(msg string, args ...any)
Warn(msg string, args ...any)
Error(msg string, args ...any)
}
Logger defines the interface for logging operations.
type Meter ¶
type Meter interface {
RecordHistogram(ctx context.Context, name string, value float64, attrs ...Attribute)
RecordCounter(ctx context.Context, name string, value float64, attrs ...Attribute)
}
Meter defines the interface for recording metrics.
type Observability ¶
Observability contains the logging, tracing, and metering interfaces used throughout the Cypher execution pipeline.
func NewObservability ¶
func NewObservability(opts ...ObservabilityOption) *Observability
NewObservability creates a new Observability instance with default (no-op) implementations.
type ObservabilityOption ¶
type ObservabilityOption func(*Observability)
ObservabilityOption configures optional parameters for observability.
func WithLogger ¶
func WithLogger(l Logger) ObservabilityOption
WithLogger sets the Logger implementation.
func WithMeter ¶
func WithMeter(m Meter) ObservabilityOption
WithMeter sets the Meter implementation.
func WithTracer ¶
func WithTracer(t Tracer) ObservabilityOption
WithTracer sets the Tracer implementation.
type Result ¶
type Result struct {
// AffectedNodes is the number of nodes created, modified, or deleted.
AffectedNodes int
// AffectedRels is the number of relationships created or deleted.
AffectedRels int
// Rows contains matched data rows for MATCH queries.
Rows []map[string]interface{}
// Columns contains the names of columns returned in Rows.
Columns []string
}
Result contains the count of affected graph elements after executing a data-modifying Cypher query (CREATE, SET, DELETE, REMOVE).
func (*Result) AddAffected ¶
AddAffected increments the count of affected nodes and relationships.