Documentation
¶
Index ¶
- Constants
- type CallSubquery
- type CallSubqueryClause
- type CallSubqueryWith
- type CaseExpression
- type CaseExpressionElse
- type CaseExpressionWhen
- type Collect
- type Count
- type CountFunction
- type Create
- type CreateClause
- type CreateElement
- type CreateElementChain
- type CreateExistingNode
- type CreateNewNode
- type CreateNode
- type CreatePathElement
- type CyclicPath
- type Delete
- type DeleteClause
- type DeleteElementChain
- type EmptyClause
- type ExistingLabel
- type ExistingProperty
- type Exists
- type Expression
- type Foreach
- type ForeachClause
- type ForeachCommand
- type ForeachVariable
- type FunctionApplicationExpression
- func (c *FunctionApplicationExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
- func (c FunctionApplicationExpression) TemplateString() string
- func (c FunctionApplicationExpression) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
- type GenericCaseExpression
- type Index
- type Label
- type LabelMatch
- type LabelName
- type Labels
- type ListComprehension
- type ListComprehensionPrefix
- type ListComprehensionSuffix
- type ListExpression
- type ListLiteral
- type ListLiteralItem
- type Match
- type MatchClause
- type MatchElementChain
- type MatchNode
- type MatchRelationship
- type Merge
- type MergeClause
- type NewLabel
- type NewProperty
- type OperatorApplicationExpression
- func (c *OperatorApplicationExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
- func (c OperatorApplicationExpression) TemplateString() string
- func (c OperatorApplicationExpression) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
- type OptionalLabelMatch
- type OptionalLimit
- type OptionalOrderBy
- type OptionalProperties
- type OptionalPropertyMatch
- type OptionalSkip
- type OptionalStructureName
- type OptionalWhereClause
- type OptionalWriteQuery
- type OrderByExpression
- type OrderByExpressionChain
- type PathPatternExpression
- type PredeterminedReturn
- type Predicate
- type PredicatePrefix
- type Properties
- type PropertiesMatch
- type Property
- type PropertyChain
- type PropertyLiteral
- type PropertyName
- type ReadClause
- type Remove
- type RemoveClause
- type RemoveLabelExpression
- type RemovePropertyExpression
- type RemoveSubclause
- type Return
- type ReturnElement
- type ReturnElementChain
- type ReversiblePath
- type Set
- type SetClause
- type SetExpression
- type SetLabelExpression
- type SetPropertyExpression
- type SimpleCaseExpression
- type SimpleSubqueryExpressionBody
- type StructureName
- type SubqueryExpression
- type SubqueryExpressionBody
- type SubqueryExpressionBodyPart
- type TransformablePath
- type Union
- type UnionClause
- type Unwind
- type UnwindClause
- type VariableExpression
- type WhereClause
- type WhereExpression
- type With
- type WithClause
- type WithElement
- type WithElementChain
- type WriteClause
- type WriteTarget
Constants ¶
const ( // Left indicates a relationship direction from right to left Left relationshipDirection = -1 // None indicates no relationship None relationshipDirection = 0 // Right indicates a relationship direction from left to right Right relationshipDirection = 1 // Any indicates a unidirectional relationship direction Any relationshipDirection = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallSubquery ¶
type CallSubquery struct{}
A CallSubquery clause must take into account the following three restrictions:
- A subquery can only refer to variables from the enclosing query if they are explicitly imported.
- A subquery cannot return variables with the same names as variables in the enclosing query.
- All variables that are returned from a subquery are afterwards available in the enclosing query.
func (*CallSubquery) Generate ¶
func (c *CallSubquery) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CallSubquery
func (CallSubquery) TemplateString ¶
func (c CallSubquery) TemplateString() string
TemplateString for CallSubquery
type CallSubqueryClause ¶
type CallSubqueryClause struct {
// contains filtered or unexported fields
}
func (*CallSubqueryClause) Generate ¶
func (c *CallSubqueryClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CallSubqueryClause
func (CallSubqueryClause) ModifySchema ¶
func (c CallSubqueryClause) ModifySchema(s *schema.Schema)
func (CallSubqueryClause) TemplateString ¶
func (c CallSubqueryClause) TemplateString() string
TemplateString for CallSubqueryClause
type CallSubqueryWith ¶
func (*CallSubqueryWith) Generate ¶
func (c *CallSubqueryWith) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CallSubqueryWith
func (CallSubqueryWith) TemplateString ¶
func (c CallSubqueryWith) TemplateString() string
TemplateString for CallSubqueryWith
type CaseExpression ¶
type CaseExpression struct {
Conf schema.ExpressionConfig
}
func (*CaseExpression) Generate ¶
func (c *CaseExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CaseExpression
type CaseExpressionElse ¶
type CaseExpressionElse struct {
Conf schema.ExpressionConfig
}
func (*CaseExpressionElse) Generate ¶
func (c *CaseExpressionElse) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CaseExpressionElse
func (*CaseExpressionElse) TemplateString ¶
func (c *CaseExpressionElse) TemplateString() string
TemplateString for CaseExpressionElse
type CaseExpressionWhen ¶
type CaseExpressionWhen struct {
Conf schema.ExpressionConfig
// Whether this clause is part of a generic or simple case expression
IsGeneric bool
}
func (*CaseExpressionWhen) Generate ¶
func (c *CaseExpressionWhen) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CaseExpressionWhen
func (CaseExpressionWhen) NoStrategyReduce ¶
func (c CaseExpressionWhen) NoStrategyReduce(clause *helperclauses.ClauseCapturer) translator.Clause
func (CaseExpressionWhen) TemplateString ¶
func (c CaseExpressionWhen) TemplateString() string
TemplateString for CaseExpressionWhen
type Collect ¶
type Collect struct {
Conf schema.ExpressionConfig
}
type CountFunction ¶
type CountFunction struct {
// contains filtered or unexported fields
}
func (*CountFunction) Generate ¶
func (c *CountFunction) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CountFunction
func (CountFunction) TemplateString ¶
func (c CountFunction) TemplateString() string
TemplateString for CountFunction
type CreateClause ¶
type CreateClause struct{}
func (*CreateClause) Generate ¶
func (c *CreateClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CreateClause
func (*CreateClause) ModifySchema ¶
func (c *CreateClause) ModifySchema(s *schema.Schema)
func (CreateClause) TemplateString ¶
func (c CreateClause) TemplateString() string
TemplateString for CreateClause
type CreateElement ¶
type CreateElement struct {
// contains filtered or unexported fields
}
func (*CreateElement) Generate ¶
func (c *CreateElement) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CreateElement
func (CreateElement) TemplateString ¶
func (c CreateElement) TemplateString() string
TemplateString for CreateElement
type CreateElementChain ¶
type CreateElementChain struct {
// contains filtered or unexported fields
}
func (*CreateElementChain) Generate ¶
func (c *CreateElementChain) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CreateElementChain
func (CreateElementChain) NoStrategyReduce ¶
func (c CreateElementChain) NoStrategyReduce(clause *helperclauses.ClauseCapturer) translator.Clause
func (CreateElementChain) TemplateString ¶
func (c CreateElementChain) TemplateString() string
TemplateString for CreateElementChain
type CreateExistingNode ¶
type CreateExistingNode struct {
// contains filtered or unexported fields
}
func (*CreateExistingNode) Generate ¶
func (c *CreateExistingNode) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CreateExistingNode
func (CreateExistingNode) TemplateString ¶
func (c CreateExistingNode) TemplateString() string
TemplateString for CreateExistingNode
type CreateNewNode ¶
type CreateNewNode struct {
// contains filtered or unexported fields
}
func (*CreateNewNode) Generate ¶
func (c *CreateNewNode) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CreateNewNode
func (CreateNewNode) TemplateString ¶
func (c CreateNewNode) TemplateString() string
TemplateString for CreateNewNode
type CreateNode ¶
type CreateNode struct {
// Can only return CreateExisting if set to true (cannot recreate existing node)
InRelationship bool
}
func (*CreateNode) Generate ¶
func (c *CreateNode) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CreateNode
type CreatePathElement ¶
type CreatePathElement struct {
// Whether this element is part of a relationship being created
InRelationship bool
// contains filtered or unexported fields
}
func (*CreatePathElement) Generate ¶
func (c *CreatePathElement) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for CreatePathElement
func (CreatePathElement) NoStrategyReduce ¶
func (c CreatePathElement) NoStrategyReduce(clause *helperclauses.ClauseCapturer) translator.Clause
func (CreatePathElement) TemplateString ¶
func (c CreatePathElement) TemplateString() string
TemplateString for CreatePathElement
type CyclicPath ¶
type CyclicPath struct {
IsOptional bool
// contains filtered or unexported fields
}
CyclicPath is a path that matches a cycle. E.g.:
(a)-->(a) ==> (a)-->(a)-->(a)
func (*CyclicPath) Generate ¶
func (c *CyclicPath) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
func (CyclicPath) TemplateString ¶
func (c CyclicPath) TemplateString() string
func (*CyclicPath) Transform ¶
func (c *CyclicPath) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
type DeleteClause ¶
type DeleteClause struct {
// contains filtered or unexported fields
}
func (*DeleteClause) Generate ¶
func (c *DeleteClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for DeleteClause
func (DeleteClause) TemplateString ¶
func (c DeleteClause) TemplateString() string
TemplateString for DeleteClause
func (*DeleteClause) Transform ¶
func (c *DeleteClause) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
Transform a DeleteClause to an equivalent by changing a DELETE clause to be a DETACH DELETE clause instead. Since delete can only be called on relationships or nodes without relationships, changing it to a DETACH DELETE should have no effect on the query result.
type DeleteElementChain ¶
type DeleteElementChain struct {
// If this is a DETACH DELETE clause
UseDetach bool
}
func (*DeleteElementChain) Generate ¶
func (c *DeleteElementChain) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for DeleteElementChain
type EmptyClause ¶
type EmptyClause struct{}
The EmptyClause has no template string and no subclauses, thereby resulting in an empty string once translated.
func (*EmptyClause) Generate ¶
func (c *EmptyClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for EmptyClause
type ExistingLabel ¶
type ExistingLabel struct {
LabelType schema.StructuralType
// contains filtered or unexported fields
}
func (*ExistingLabel) Generate ¶
func (c *ExistingLabel) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for ExistingLabel
func (ExistingLabel) TemplateString ¶
func (c ExistingLabel) TemplateString() string
TemplateString for ExistingLabel
type ExistingProperty ¶
type ExistingProperty struct {
// contains filtered or unexported fields
}
func (*ExistingProperty) Generate ¶
func (c *ExistingProperty) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for ExistingProperty
func (ExistingProperty) TemplateString ¶
func (c ExistingProperty) TemplateString() string
TemplateString for ExistingProperty
type Expression ¶
type Expression struct {
Conf schema.ExpressionConfig
}
func (*Expression) Generate ¶
func (c *Expression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for Expression
func (Expression) NoStrategyReduce ¶
func (c Expression) NoStrategyReduce(clause *helperclauses.ClauseCapturer) translator.Clause
func (*Expression) Transform ¶
func (c *Expression) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
Transform an Expression to an equivalent through various means, depending on its type.
type ForeachClause ¶
type ForeachClause struct {
// contains filtered or unexported fields
}
func (*ForeachClause) Generate ¶
func (c *ForeachClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for ForeachClause
func (ForeachClause) ModifySchema ¶
func (c ForeachClause) ModifySchema(s *schema.Schema)
func (ForeachClause) TemplateString ¶
func (c ForeachClause) TemplateString() string
TemplateString for ForeachClause
type ForeachCommand ¶
type ForeachCommand struct{}
func (*ForeachCommand) Generate ¶
func (c *ForeachCommand) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for ForeachCommand
func (ForeachCommand) TemplateString ¶
func (c ForeachCommand) TemplateString() string
TemplateString for ForeachCommand
type ForeachVariable ¶
type ForeachVariable struct {
// contains filtered or unexported fields
}
func (*ForeachVariable) Generate ¶
func (c *ForeachVariable) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for ForeachVariable
func (ForeachVariable) ModifySchema ¶
func (c ForeachVariable) ModifySchema(s *schema.Schema)
func (ForeachVariable) TemplateString ¶
func (c ForeachVariable) TemplateString() string
TemplateString for ForeachVariable
type FunctionApplicationExpression ¶
type FunctionApplicationExpression struct {
Conf schema.ExpressionConfig
// contains filtered or unexported fields
}
A FunctionApplicationExpression generates a function application.
It chooses one of OpenCypher's required functions or one of the additional functions from the generation config. It never generates a function in the list of forbidden functions defined in the generation config.
func (*FunctionApplicationExpression) Generate ¶
func (c *FunctionApplicationExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for FunctionApplicationExpression
func (FunctionApplicationExpression) TemplateString ¶
func (c FunctionApplicationExpression) TemplateString() string
TemplateString for FunctionApplicationExpression
func (FunctionApplicationExpression) Transform ¶
func (c FunctionApplicationExpression) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
Transform a FunctionApplicationExpression to an equivalent by returning expressions evaluating to the same result as calling the function.
type GenericCaseExpression ¶
type GenericCaseExpression struct {
Conf schema.ExpressionConfig
}
func (*GenericCaseExpression) Generate ¶
func (c *GenericCaseExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for GenericCaseExpression
func (GenericCaseExpression) TemplateString ¶
func (c GenericCaseExpression) TemplateString() string
TemplateString for GenericCaseExpression
type Index ¶
type Index struct{}
The Index type serves only to be intercepted by drop-ins of implementations. Every model should have its own index implementation.
If it is not intercepted, it simply returns a root clause, generating a normal query.
type Label ¶
type Label struct {
LabelType schema.StructuralType
}
type LabelMatch ¶
type LabelMatch struct {
LabelType schema.StructuralType
// contains filtered or unexported fields
}
func (*LabelMatch) Generate ¶
func (c *LabelMatch) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for LabelMatch
func (LabelMatch) NoStrategyReduce ¶
func (c LabelMatch) NoStrategyReduce(clause *helperclauses.ClauseCapturer) translator.Clause
func (LabelMatch) TemplateString ¶
func (c LabelMatch) TemplateString() string
TemplateString for LabelMatch
type LabelName ¶
type LabelName struct {
LabelType schema.StructuralType
}
type Labels ¶
type Labels struct {
LabelType schema.StructuralType
}
type ListComprehension ¶
type ListComprehension struct {
Conf schema.ExpressionConfig
// contains filtered or unexported fields
}
func (*ListComprehension) Generate ¶
func (c *ListComprehension) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for ListComprehension
func (ListComprehension) ModifySchema ¶
func (c ListComprehension) ModifySchema(s *schema.Schema)
func (ListComprehension) TemplateString ¶
func (c ListComprehension) TemplateString() string
TemplateString for ListComprehension
type ListComprehensionPrefix ¶
type ListComprehensionPrefix struct {
Conf schema.ExpressionConfig
// contains filtered or unexported fields
}
func (*ListComprehensionPrefix) Generate ¶
func (c *ListComprehensionPrefix) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for ListComprehensionPrefix
func (ListComprehensionPrefix) ModifySchema ¶
func (c ListComprehensionPrefix) ModifySchema(s *schema.Schema)
func (ListComprehensionPrefix) TemplateString ¶
func (c ListComprehensionPrefix) TemplateString() string
TemplateString for ListComprehensionPrefix
type ListComprehensionSuffix ¶
type ListComprehensionSuffix struct {
Conf schema.ExpressionConfig
}
func (*ListComprehensionSuffix) Generate ¶
func (c *ListComprehensionSuffix) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for ListComprehensionSuffix
func (ListComprehensionSuffix) TemplateString ¶
func (c ListComprehensionSuffix) TemplateString() string
TemplateString for ListComprehensionSuffix
type ListExpression ¶
type ListExpression struct {
Conf schema.ExpressionConfig
// contains filtered or unexported fields
}
func (*ListExpression) Generate ¶
func (c *ListExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for ListExpression
func (ListExpression) TemplateString ¶
func (c ListExpression) TemplateString() string
TemplateString for ListExpression
type ListLiteral ¶
type ListLiteral struct {
Conf schema.ExpressionConfig
}
func (*ListLiteral) Generate ¶
func (c *ListLiteral) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for ListLiteral
func (ListLiteral) TemplateString ¶
func (c ListLiteral) TemplateString() string
TemplateString for ListLiteral
type ListLiteralItem ¶
type ListLiteralItem struct {
Conf schema.ExpressionConfig
// contains filtered or unexported fields
}
func (*ListLiteralItem) Generate ¶
func (c *ListLiteralItem) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for ListLiteralItem
func (ListLiteralItem) TemplateString ¶
func (c ListLiteralItem) TemplateString() string
TemplateString for ListLiteralItem
type MatchClause ¶
type MatchClause struct {
// contains filtered or unexported fields
}
func (*MatchClause) Generate ¶
func (c *MatchClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for MatchClause
func (MatchClause) TemplateString ¶
func (c MatchClause) TemplateString() string
TemplateString for MatchClause
type MatchElementChain ¶
func (*MatchElementChain) Generate ¶
func (c *MatchElementChain) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for MatchElementChain
func (MatchElementChain) NoStrategyReduce ¶
func (c MatchElementChain) NoStrategyReduce(clause *helperclauses.ClauseCapturer) translator.Clause
func (MatchElementChain) TemplateString ¶
func (c MatchElementChain) TemplateString() string
TemplateString for MatchElementChain
type MatchNode ¶
type MatchNode struct {
IsOptional bool
}
func (*MatchNode) TemplateString ¶
TemplateString for MatchNode
type MatchRelationship ¶
type MatchRelationship struct {
IsOptional bool
// contains filtered or unexported fields
}
func (*MatchRelationship) Generate ¶
func (c *MatchRelationship) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for MatchRelationship
func (*MatchRelationship) TemplateString ¶
func (c *MatchRelationship) TemplateString() string
TemplateString for MatchRelationship
func (*MatchRelationship) Transform ¶
func (c *MatchRelationship) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
Transform a MatchRelationship to an equivalent using the fact that
()-[*x..y]-() => ()-[*x-z..y-z]-()-[*z..z]-()
type MergeClause ¶
type MergeClause struct {
// contains filtered or unexported fields
}
func (*MergeClause) Generate ¶
func (c *MergeClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for MergeClause
func (MergeClause) ModifySchema ¶
func (c MergeClause) ModifySchema(s *schema.Schema)
func (MergeClause) TemplateString ¶
func (c MergeClause) TemplateString() string
TemplateString for MergeClause
type NewLabel ¶
type NewLabel struct {
LabelType schema.StructuralType
// contains filtered or unexported fields
}
func (NewLabel) TemplateString ¶
TemplateString for NewLabel
type NewProperty ¶
type NewProperty struct {
// contains filtered or unexported fields
}
func (*NewProperty) Generate ¶
func (c *NewProperty) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for NewProperty
func (NewProperty) TemplateString ¶
func (c NewProperty) TemplateString() string
TemplateString for NewProperty
type OperatorApplicationExpression ¶
type OperatorApplicationExpression struct {
Conf schema.ExpressionConfig
// contains filtered or unexported fields
}
func (*OperatorApplicationExpression) Generate ¶
func (c *OperatorApplicationExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for OperatorApplicationExpression
func (OperatorApplicationExpression) TemplateString ¶
func (c OperatorApplicationExpression) TemplateString() string
TemplateString for OperatorApplicationExpression
func (OperatorApplicationExpression) Transform ¶
func (c OperatorApplicationExpression) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
Transform an OperatorApplicationExpression to an equivalent expression.
type OptionalLabelMatch ¶
type OptionalLabelMatch struct {
LabelType schema.StructuralType
// contains filtered or unexported fields
}
func (*OptionalLabelMatch) Generate ¶
func (c *OptionalLabelMatch) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for OptionalLabelMatch
func (OptionalLabelMatch) TemplateString ¶
func (c OptionalLabelMatch) TemplateString() string
TemplateString for OptionalLabelMatch
type OptionalLimit ¶
type OptionalLimit struct {
// contains filtered or unexported fields
}
func (*OptionalLimit) Generate ¶
func (c *OptionalLimit) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for OptionalLimit
func (OptionalLimit) TemplateString ¶
func (c OptionalLimit) TemplateString() string
TemplateString for OptionalLimit
type OptionalOrderBy ¶
type OptionalOrderBy struct {
// contains filtered or unexported fields
}
func (*OptionalOrderBy) Generate ¶
func (c *OptionalOrderBy) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for OptionalOrderBy
func (OptionalOrderBy) TemplateString ¶
func (c OptionalOrderBy) TemplateString() string
TemplateString for OptionalOrderBy
type OptionalProperties ¶
type OptionalProperties struct{}
func (*OptionalProperties) Generate ¶
func (c *OptionalProperties) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for OptionalProperties
type OptionalPropertyMatch ¶
type OptionalPropertyMatch struct{}
func (*OptionalPropertyMatch) Generate ¶
func (c *OptionalPropertyMatch) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for OptionalPropertyMatch
type OptionalSkip ¶
type OptionalSkip struct {
// contains filtered or unexported fields
}
func (*OptionalSkip) Generate ¶
func (c *OptionalSkip) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for OptionalSkip
func (OptionalSkip) TemplateString ¶
func (c OptionalSkip) TemplateString() string
TemplateString for OptionalSkip
type OptionalStructureName ¶
type OptionalStructureName struct {
NameType *schema.StructuralType
// contains filtered or unexported fields
}
func (*OptionalStructureName) Generate ¶
func (c *OptionalStructureName) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for OptionalStructureName
type OptionalWhereClause ¶
type OptionalWhereClause struct {
// contains filtered or unexported fields
}
func (*OptionalWhereClause) Generate ¶
func (c *OptionalWhereClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for OptionalWhereClause
func (OptionalWhereClause) Transform ¶
func (c OptionalWhereClause) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
Transform an OptionalWhereClause to an equivalent by having its expression evaluate to true if it wasn't generated. Since the where clause wasn't generated in the original query, it didn't filter out anything. A WHERE true clause also doesn't filter out anything, thus it shouldn't change the outcome of the query.
type OptionalWriteQuery ¶
type OptionalWriteQuery struct{}
func (*OptionalWriteQuery) Generate ¶
func (c *OptionalWriteQuery) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for OptionalWriteQuery
type OrderByExpression ¶
type OrderByExpression struct {
// contains filtered or unexported fields
}
func (*OrderByExpression) Generate ¶
func (c *OrderByExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for OrderByExpression
func (OrderByExpression) TemplateString ¶
func (c OrderByExpression) TemplateString() string
TemplateString for OrderByExpression
type OrderByExpressionChain ¶
type OrderByExpressionChain struct {
// contains filtered or unexported fields
}
func (*OrderByExpressionChain) Generate ¶
func (c *OrderByExpressionChain) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for OrderByExpressionChain
func (OrderByExpressionChain) TemplateString ¶
func (c OrderByExpressionChain) TemplateString() string
TemplateString for OrderByExpressionChain
type PathPatternExpression ¶
type PathPatternExpression struct {
IsOptional bool
// contains filtered or unexported fields
}
func (*PathPatternExpression) Generate ¶
func (c *PathPatternExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for PathPatternExpression
func (PathPatternExpression) NoStrategyReduce ¶
func (c PathPatternExpression) NoStrategyReduce(clause *helperclauses.ClauseCapturer) translator.Clause
func (PathPatternExpression) TemplateString ¶
func (c PathPatternExpression) TemplateString() string
TemplateString for PathPatternExpression
type PredeterminedReturn ¶
type PredeterminedReturn struct {
// contains filtered or unexported fields
}
A PredeterminedReturn has its return names and types defined in the schema and is only generated if the schema's MustReturn boolean is set to true
func (*PredeterminedReturn) Generate ¶
func (c *PredeterminedReturn) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for PredeterminedReturn
func (PredeterminedReturn) TemplateString ¶
func (c PredeterminedReturn) TemplateString() string
TemplateString for PredeterminedReturn
type Predicate ¶
type Predicate struct {
Conf schema.ExpressionConfig
// contains filtered or unexported fields
}
func (Predicate) ModifySchema ¶
func (Predicate) TemplateString ¶
TemplateString for Predicate
type PredicatePrefix ¶
type PredicatePrefix struct {
Conf schema.ExpressionConfig
// contains filtered or unexported fields
}
The PredicatePrefix represents the left part of the predicate which defines a new variable.
func (*PredicatePrefix) Generate ¶
func (c *PredicatePrefix) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for PredicatePrefix
func (PredicatePrefix) ModifySchema ¶
func (c PredicatePrefix) ModifySchema(s *schema.Schema)
func (PredicatePrefix) TemplateString ¶
func (c PredicatePrefix) TemplateString() string
TemplateString for PredicatePrefix
type Properties ¶
type Properties struct{}
func (*Properties) Generate ¶
func (c *Properties) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for Properties
func (Properties) TemplateString ¶
func (c Properties) TemplateString() string
TemplateString for Properties
type PropertiesMatch ¶
type PropertiesMatch struct{}
PropertiesMatch is similar to Properties, but with different probabilities of matching new and existing properties.
func (*PropertiesMatch) Generate ¶
func (c *PropertiesMatch) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for PropertiesMatch
func (PropertiesMatch) TemplateString ¶
func (c PropertiesMatch) TemplateString() string
TemplateString for PropertiesMatch
type Property ¶
type Property struct{}
Property is currently unused because properties get generated using PropertyChain. However, it might be useful in the future for implementation specific generation.
type PropertyChain ¶
type PropertyChain struct {
// Probability of choosing to create a new property instead of using an existing one
CreateNewPropertyProbability float64
// contains filtered or unexported fields
}
func (*PropertyChain) Generate ¶
func (c *PropertyChain) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for PropertyChain
func (PropertyChain) NoStrategyReduce ¶
func (c PropertyChain) NoStrategyReduce(clause *helperclauses.ClauseCapturer) translator.Clause
func (PropertyChain) TemplateString ¶
func (c PropertyChain) TemplateString() string
TemplateString for PropertyChain
type PropertyLiteral ¶
type PropertyLiteral struct {
Conf schema.ExpressionConfig
// contains filtered or unexported fields
}
func (*PropertyLiteral) Generate ¶
func (c *PropertyLiteral) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for PropertyLiteral
func (PropertyLiteral) TemplateString ¶
func (c PropertyLiteral) TemplateString() string
TemplateString for PropertyLiteral
func (*PropertyLiteral) Transform ¶
func (c *PropertyLiteral) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
Transform a PropertyLiteral to an equivalent through various means, depending on its type.
type PropertyName ¶
type PropertyName struct {
NameType *schema.PropertyType
// contains filtered or unexported fields
}
TODO: Let PropertyName reuse names from the schema - will have to update full prometheus exporter once implemented
func (*PropertyName) Generate ¶
func (c *PropertyName) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for PropertyName
func (PropertyName) TemplateString ¶
func (c PropertyName) TemplateString() string
TemplateString for PropertyName
type ReadClause ¶
type ReadClause struct {
// If this is set, a generated WITH cannot generate additonal ORDER BY, SKIP or LIMIT clauses.
// Used by CALL {} subquery and UNION
SimpleWithClause bool
}
A ReadClause is always succeeded another root clause, the only exception being WriteClause.
func (*ReadClause) Generate ¶
func (c *ReadClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for RootClause
func (ReadClause) Transform ¶
func (c ReadClause) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
Transform a RootClause to an equivalent using one of the following facts:
- Enclosing a RootClause in a WITH * should have no influence on its behavior, as variable aren't redefined.
- Enclosing a RootClause in an UNWIND, iterating over a single value shouldn't change the query's behavior.
type RemoveClause ¶
type RemoveClause struct{}
func (*RemoveClause) Generate ¶
func (c *RemoveClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for RemoveClause
func (RemoveClause) TemplateString ¶
func (c RemoveClause) TemplateString() string
TemplateString for RemoveClause
type RemoveLabelExpression ¶
type RemoveLabelExpression struct {
// contains filtered or unexported fields
}
RemoveLabelExpression represents the expression used for stripping labels from a structural variable. If there is no available candidate, it defaults to generating a RemovePropertyExpression.
func (*RemoveLabelExpression) Generate ¶
func (c *RemoveLabelExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for RemoveLabelExpression
func (RemoveLabelExpression) TemplateString ¶
func (c RemoveLabelExpression) TemplateString() string
TemplateString for RemoveLabelExpression
type RemovePropertyExpression ¶
type RemovePropertyExpression struct{}
func (*RemovePropertyExpression) Generate ¶
func (c *RemovePropertyExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for RemovePropertyExpression
func (RemovePropertyExpression) TemplateString ¶
func (c RemovePropertyExpression) TemplateString() string
TemplateString for RemovePropertyExpression
type RemoveSubclause ¶
type RemoveSubclause struct {
// contains filtered or unexported fields
}
func (*RemoveSubclause) Generate ¶
func (c *RemoveSubclause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for RemoveSubclause
func (RemoveSubclause) TemplateString ¶
func (c RemoveSubclause) TemplateString() string
TemplateString for RemoveSubclause
func (*RemoveSubclause) Transform ¶
func (c *RemoveSubclause) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
Transform a RemoveSubclause to an equivalent by repeating one of its targets. Removing an element a second time should have no influence on the query result, since the target is already removed.
type Return ¶
type Return struct {
// contains filtered or unexported fields
}
type ReturnElement ¶
type ReturnElement struct{}
func (*ReturnElement) Generate ¶
func (c *ReturnElement) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for ReturnElement
func (ReturnElement) TemplateString ¶
func (c ReturnElement) TemplateString() string
TemplateString for ReturnElement
type ReturnElementChain ¶
type ReturnElementChain struct {
// contains filtered or unexported fields
}
func (*ReturnElementChain) Generate ¶
func (c *ReturnElementChain) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for ReturnElementChain
func (ReturnElementChain) TemplateString ¶
func (c ReturnElementChain) TemplateString() string
TemplateString for ReturnElementChain
type ReversiblePath ¶
type ReversiblePath struct {
IsOptional bool
// contains filtered or unexported fields
}
ReversiblePath is a path that is reversed during transformation. E.g.:
(a)-[b]->(c) ==> (c)<-[b]-(a)
func (*ReversiblePath) Generate ¶
func (c *ReversiblePath) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
func (ReversiblePath) TemplateString ¶
func (c ReversiblePath) TemplateString() string
TemplateString for PathPatternExpression
func (*ReversiblePath) Transform ¶
func (c *ReversiblePath) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
type SetClause ¶
type SetClause struct{}
func (SetClause) TemplateString ¶
TemplateString for SetClause
type SetExpression ¶
type SetExpression struct {
// contains filtered or unexported fields
}
func (*SetExpression) Generate ¶
func (c *SetExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for SetExpression
func (SetExpression) NoStrategyReduce ¶
func (c SetExpression) NoStrategyReduce(clause *helperclauses.ClauseCapturer) translator.Clause
func (SetExpression) TemplateString ¶
func (c SetExpression) TemplateString() string
TemplateString for SetExpression
type SetLabelExpression ¶
type SetLabelExpression struct {
// contains filtered or unexported fields
}
func (*SetLabelExpression) Generate ¶
func (c *SetLabelExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for SetLabelExpression
func (SetLabelExpression) TemplateString ¶
func (c SetLabelExpression) TemplateString() string
TemplateString for SetLabelExpression
type SetPropertyExpression ¶
type SetPropertyExpression struct {
// contains filtered or unexported fields
}
func (*SetPropertyExpression) Generate ¶
func (c *SetPropertyExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for SetPropertyExpression
func (SetPropertyExpression) TemplateString ¶
func (c SetPropertyExpression) TemplateString() string
TemplateString for SetPropertyExpression
type SimpleCaseExpression ¶
type SimpleCaseExpression struct {
Conf schema.ExpressionConfig
}
func (*SimpleCaseExpression) Generate ¶
func (c *SimpleCaseExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for SimpleCaseExpression
func (SimpleCaseExpression) TemplateString ¶
func (c SimpleCaseExpression) TemplateString() string
TemplateString for SimpleCaseExpression
type SimpleSubqueryExpressionBody ¶
type SimpleSubqueryExpressionBody struct {
// contains filtered or unexported fields
}
Only has a path pattern and an optional WHERE clause
func (*SimpleSubqueryExpressionBody) Generate ¶
func (c *SimpleSubqueryExpressionBody) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for SimpleSubqueryExpressionBody
func (SimpleSubqueryExpressionBody) ModifySchema ¶
func (c SimpleSubqueryExpressionBody) ModifySchema(s *schema.Schema)
type StructureName ¶
type StructureName struct {
NameType *schema.StructuralType
// contains filtered or unexported fields
}
func (*StructureName) Generate ¶
func (c *StructureName) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for StructureName
func (StructureName) TemplateString ¶
func (c StructureName) TemplateString() string
TemplateString for StructureName
type SubqueryExpression ¶
type SubqueryExpression struct {
ColumnNameToReturn string
ColumnExpressionToReturn schema.ExpressionConfig
// contains filtered or unexported fields
}
func (*SubqueryExpression) Generate ¶
func (c *SubqueryExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for SubqueryExpression
func (SubqueryExpression) ModifySchema ¶
func (c SubqueryExpression) ModifySchema(s *schema.Schema)
type SubqueryExpressionBody ¶
type SubqueryExpressionBody struct {
// If unset, no union. If set and true, UNION ALL, if set and false, UNION
IsUnionAll *bool
MustReturn bool
// contains filtered or unexported fields
}
func (*SubqueryExpressionBody) Generate ¶
func (c *SubqueryExpressionBody) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for SubqueryExpressionBody
func (SubqueryExpressionBody) TemplateString ¶
func (c SubqueryExpressionBody) TemplateString() string
TemplateString for SubqueryExpressionBody
type SubqueryExpressionBodyPart ¶
type SubqueryExpressionBodyPart struct {
MustReturn bool
// contains filtered or unexported fields
}
func (*SubqueryExpressionBodyPart) Generate ¶
func (c *SubqueryExpressionBodyPart) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for SubqueryExpressionBodyPart
func (SubqueryExpressionBodyPart) ModifySchema ¶
func (c SubqueryExpressionBodyPart) ModifySchema(s *schema.Schema)
func (SubqueryExpressionBodyPart) TemplateString ¶
func (c SubqueryExpressionBodyPart) TemplateString() string
TemplateString for SubqueryExpressionBodyPart
type TransformablePath ¶
type TransformablePath struct {
IsOptional bool
// contains filtered or unexported fields
}
func (*TransformablePath) Generate ¶
func (c *TransformablePath) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
type Union ¶
type Union struct {
// contains filtered or unexported fields
}
func (Union) NoStrategyReduce ¶
func (c Union) NoStrategyReduce(clause *helperclauses.ClauseCapturer) translator.Clause
type UnionClause ¶
type UnionClause struct {
// contains filtered or unexported fields
}
func (*UnionClause) Generate ¶
func (c *UnionClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for UnionClause
func (UnionClause) ModifySchema ¶
func (c UnionClause) ModifySchema(s *schema.Schema)
type UnwindClause ¶
type UnwindClause struct {
VariableConfig schema.ExpressionConfig
// contains filtered or unexported fields
}
func (*UnwindClause) Generate ¶
func (c *UnwindClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for UnwindClause
func (UnwindClause) ModifySchema ¶
func (c UnwindClause) ModifySchema(s *schema.Schema)
func (UnwindClause) TemplateString ¶
func (c UnwindClause) TemplateString() string
TemplateString for UnwindClause
type VariableExpression ¶
type VariableExpression struct {
Conf schema.ExpressionConfig
// contains filtered or unexported fields
}
func (*VariableExpression) Generate ¶
func (c *VariableExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for VariableExpression
func (VariableExpression) TemplateString ¶
func (c VariableExpression) TemplateString() string
TemplateString for VariableExpression
type WhereClause ¶
type WhereClause struct{}
func (*WhereClause) Generate ¶
func (c *WhereClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for WhereClause
func (WhereClause) TemplateString ¶
func (c WhereClause) TemplateString() string
TemplateString for WhereClause
type WhereExpression ¶
type WhereExpression struct{}
func (*WhereExpression) Generate ¶
func (c *WhereExpression) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for WhereExpression
type With ¶
type With struct {
SimpleWithClause bool
}
type WithClause ¶
type WithClause struct {
IsIncludeAll bool
}
func (*WithClause) Generate ¶
func (c *WithClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for WithClause
func (WithClause) TemplateString ¶
func (c WithClause) TemplateString() string
TemplateString for WithClause
func (*WithClause) Transform ¶
func (c *WithClause) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
Transform a WithClause to an equivalent by including an additional with element. Since this element wasn't present the first time the clause got generated, it will not be referenced again later, thus it shouldn't change the outcome of the query.
type WithElement ¶
type WithElement struct {
Name string
Conf schema.ExpressionConfig
}
func (*WithElement) Generate ¶
func (c *WithElement) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for WithElement
func (WithElement) TemplateString ¶
func (c WithElement) TemplateString() string
TemplateString for WithElement
type WithElementChain ¶
type WithElementChain struct {
// contains filtered or unexported fields
}
func (*WithElementChain) Generate ¶
func (c *WithElementChain) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for WithElementChain
func (WithElementChain) ModifySchema ¶
func (c WithElementChain) ModifySchema(s *schema.Schema)
func (WithElementChain) TemplateString ¶
func (c WithElementChain) TemplateString() string
TemplateString for WithElementChain
type WriteClause ¶
type WriteClause struct{}
A WriteClause is always succeeded by an (optional) write clause, the only exception being Return.
func (*WriteClause) Generate ¶
func (c *WriteClause) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for WriteQuery
func (WriteClause) Transform ¶
func (c WriteClause) Transform(seed *seed.Seed, s *schema.Schema, subclauses []translator.Clause) translator.Clause
Transform a WriteClause to an equivalent using one of the following facts:
- FOREACH (I IN <null|[]> | ...) should never execute, including it should have no effect.
- Enclosing a WriteClause in a FOREACH, iterating over a single value shouldn't change the query's behavior.
- Enclosing a WriteClause in a WITH * should have no influence on its behavior, as variable aren't redefined.
- CREATE <x> DELETE <x> shouldn't change the query's behavior, as everything created in the first clause gets deleted right afterwards.
type WriteTarget ¶
type WriteTarget struct {
TargetType schema.StructuralType
}
WriteTarget represents the target of a DELETE, REMOVE or SET clause.
If NoWriteTargetIndirection is set in the generation config, this clause expects that it was already checked that there is an available candidate.
func (*WriteTarget) Generate ¶
func (c *WriteTarget) Generate(seed *seed.Seed, s *schema.Schema) []translator.Clause
Generate subclauses for WriteTarget
Source Files
¶
- call_subquery.go
- case.go
- constant.go
- create.go
- delete.go
- delete_transform.go
- expression.go
- expression_transform.go
- foreach.go
- function_expression.go
- function_expression_transform.go
- index.go
- label.go
- list_expression.go
- match.go
- match_transform.go
- merge.go
- name.go
- operator_application.go
- operator_application_transform.go
- path_match.go
- path_match_transform.go
- predicate.go
- property.go
- property_literal.go
- property_literal_transform.go
- remove.go
- remove_transform.go
- return.go
- rootclause.go
- rootclause_transformer.go
- set.go
- subquery_expression.go
- transformable_path.go
- union.go
- unwind.go
- util.go
- with.go
- with_transform.go