Documentation
¶
Index ¶
- Variables
- func MeasureDuration(Func func()) time.Duration
- type AndOrExpression
- type Asset
- type AssetKey
- type AssetWithID
- type Cursor
- type ExpressionBuilder
- type ExpressionParser
- func (ep *ExpressionParser) ParseAddOrSubtractExpression(q *query.QueryAddOrSubtractExpression) error
- func (ep *ExpressionParser) ParseComparisonExpression(q *query.QueryComparisonExpression) error
- func (ep *ExpressionParser) ParseExpression(q *query.QueryExpression) error
- func (ep *ExpressionParser) ParseMultipleDivideModuloExpression(q *query.QueryMultipleDivideModuloExpression) error
- func (ep *ExpressionParser) ParseNotExpression(q *query.QueryNotExpression) error
- func (ep *ExpressionParser) ParseOrExpression(q *query.QueryOrExpression) error
- func (ep *ExpressionParser) ParsePowerOfExpression(q *query.QueryPowerOfExpression) error
- func (ep *ExpressionParser) ParsePropertyOrLabelsExpression(q *query.QueryPropertyOrLabelsExpression) error
- func (ep *ExpressionParser) ParseRelationshipsPattern(q *query.QueryRelationshipsPattern) error
- func (ep *ExpressionParser) ParseStringListNullOperatorExpression(q *query.QueryStringListNullOperatorExpression) error
- func (ep *ExpressionParser) ParseUnaryAddOrSubtractExpression(q *query.QueryUnaryAddOrSubtractExpression) error
- func (ep *ExpressionParser) ParseXorExpression(q *query.QueryXorExpression) error
- type ExpressionType
- type ExpressionVisitor
- type ExpressionVisitorBase
- func (evb *ExpressionVisitorBase) OnAddOrSubtractOperator(operator query.AddOrSubtractOperator) error
- func (evb *ExpressionVisitorBase) OnBooleanLiteral(value bool) error
- func (evb *ExpressionVisitorBase) OnComparisonOperator(operator query.ComparisonOperator) error
- func (evb *ExpressionVisitorBase) OnDoubleLiteral(value float64) error
- func (evb *ExpressionVisitorBase) OnEnterAddOrSubtractExpression() error
- func (evb *ExpressionVisitorBase) OnEnterAndExpression() error
- func (evb *ExpressionVisitorBase) OnEnterComparisonExpression() error
- func (evb *ExpressionVisitorBase) OnEnterExpression() error
- func (evb *ExpressionVisitorBase) OnEnterFunctionInvocation(name string, distinct bool) error
- func (evb *ExpressionVisitorBase) OnEnterMultipleDivideModuloExpression() error
- func (evb *ExpressionVisitorBase) OnEnterNotExpression(not bool) error
- func (evb *ExpressionVisitorBase) OnEnterOrExpression() error
- func (evb *ExpressionVisitorBase) OnEnterParenthesizedExpression() error
- func (evb *ExpressionVisitorBase) OnEnterPowerOfExpression() error
- func (evb *ExpressionVisitorBase) OnEnterPropertyOrLabelsExpression(e query.QueryPropertyOrLabelsExpression) error
- func (evb *ExpressionVisitorBase) OnEnterRelationshipsPattern(q query.QueryRelationshipsPattern, id int) error
- func (evb *ExpressionVisitorBase) OnEnterStringListNullOperatorExpression(e query.QueryStringListNullOperatorExpression) error
- func (evb *ExpressionVisitorBase) OnEnterUnaryExpression() error
- func (evb *ExpressionVisitorBase) OnEnterXorExpression() error
- func (evb *ExpressionVisitorBase) OnExitAddOrSubtractExpression() error
- func (evb *ExpressionVisitorBase) OnExitAndExpression() error
- func (evb *ExpressionVisitorBase) OnExitComparisonExpression() error
- func (evb *ExpressionVisitorBase) OnExitExpression() error
- func (evb *ExpressionVisitorBase) OnExitFunctionInvocation(name string, distinct bool) error
- func (evb *ExpressionVisitorBase) OnExitMultipleDivideModuloExpression() error
- func (evb *ExpressionVisitorBase) OnExitNotExpression(not bool) error
- func (evb *ExpressionVisitorBase) OnExitOrExpression() error
- func (evb *ExpressionVisitorBase) OnExitParenthesizedExpression() error
- func (evb *ExpressionVisitorBase) OnExitPowerOfExpression() error
- func (evb *ExpressionVisitorBase) OnExitPropertyOrLabelsExpression(e query.QueryPropertyOrLabelsExpression) error
- func (evb *ExpressionVisitorBase) OnExitRelationshipsPattern(q query.QueryRelationshipsPattern, id int) error
- func (evb *ExpressionVisitorBase) OnExitStringListNullOperatorExpression(e query.QueryStringListNullOperatorExpression) error
- func (evb *ExpressionVisitorBase) OnExitUnaryExpression() error
- func (evb *ExpressionVisitorBase) OnExitXorExpression() error
- func (evb *ExpressionVisitorBase) OnIntegerLiteral(value int64) error
- func (evb *ExpressionVisitorBase) OnMultiplyDivideModuloOperator(operator query.MultiplyDivideModuloOperator) error
- func (evb *ExpressionVisitorBase) OnNodePattern(q query.QueryNodePattern) error
- func (evb *ExpressionVisitorBase) OnRelationshipPattern(q query.QueryRelationshipPattern) error
- func (evb *ExpressionVisitorBase) OnStringLiteral(value string) error
- func (evb *ExpressionVisitorBase) OnStringOperator(operator query.StringOperator) error
- func (evb *ExpressionVisitorBase) OnVariable(name string) error
- func (evb *ExpressionVisitorBase) OnVariablePropertiesPath(propertiesPath []string) error
- type FunctionInvocationContext
- type Graph
- func (g *Graph) AddAsset(assetType schema.AssetType, assetKey string) AssetKey
- func (g *Graph) AddRelation(from AssetKey, relationType schema.RelationKeyType, to AssetKey) Relation
- func (g *Graph) Assets() []Asset
- func (g *Graph) Copy() *Graph
- func (g *Graph) Equal(other *Graph) bool
- func (g *Graph) ExtractSchema() schema.SchemaGraph
- func (g *Graph) HasAsset(asset Asset) bool
- func (g *Graph) HasRelation(relation Relation) bool
- func (g *Graph) MarshalJSON() ([]byte, error)
- func (g *Graph) Merge(other *Graph)
- func (g *Graph) Relations() []Relation
- func (g *Graph) UnmarshalJSON(b []byte) error
- type GraphBinder
- type GraphDB
- type GraphDecoder
- type GraphEncoder
- type GraphJSON
- type GraphQueryResult
- type GraphUpdater
- func (sl *GraphUpdater) InsertAssets(ctx context.Context, source string, assets []Asset) error
- func (sl *GraphUpdater) InsertRelations(ctx context.Context, source string, relations []Relation) error
- func (sl *GraphUpdater) RemoveAssets(ctx context.Context, source string, assets []Asset) error
- func (sl *GraphUpdater) RemoveRelations(ctx context.Context, source string, relations []Relation) error
- func (sl *GraphUpdater) UpdateSchema(ctx context.Context, source string, sg schema.SchemaGraph) error
- type GraphUpdatesBulk
- func (gub *GraphUpdatesBulk) Clear()
- func (gub *GraphUpdatesBulk) GetAssetRemovals() []Asset
- func (gub *GraphUpdatesBulk) GetAssetUpserts() []Asset
- func (gub *GraphUpdatesBulk) GetRelationRemovals() []Relation
- func (gub *GraphUpdatesBulk) GetRelationUpserts() []Relation
- func (gub *GraphUpdatesBulk) HasAssetRemoval(asset Asset) bool
- func (gub *GraphUpdatesBulk) HasAssetUpsert(asset Asset) bool
- func (gub *GraphUpdatesBulk) HasRelationRemoval(relation Relation) bool
- func (gub *GraphUpdatesBulk) HasRelationUpsert(relation Relation) bool
- func (gub *GraphUpdatesBulk) MarshalJSON() ([]byte, error)
- func (gub *GraphUpdatesBulk) RemoveAsset(asset Asset)
- func (gub *GraphUpdatesBulk) RemoveAssets(assets ...Asset)
- func (gub *GraphUpdatesBulk) RemoveRelation(relation Relation)
- func (gub *GraphUpdatesBulk) RemoveRelations(relations ...Relation)
- func (gub *GraphUpdatesBulk) UnmarshalJSON(bytes []byte) error
- func (gub *GraphUpdatesBulk) UpsertAsset(asset Asset)
- func (gub *GraphUpdatesBulk) UpsertAssets(assets ...Asset)
- func (gub *GraphUpdatesBulk) UpsertRelation(relation Relation)
- func (gub *GraphUpdatesBulk) UpsertRelations(relations ...Relation)
- type GraphUpdatesBulkJSON
- type GraphUpdatesQueue
- type PatternContext
- type PatternParser
- type Projection
- type ProjectionItem
- type ProjectionVisitor
- func (pv *ProjectionVisitor) OnEnterFunctionInvocation(name string, distinct bool) error
- func (pv *ProjectionVisitor) OnExitFunctionInvocation(name string, distinct bool) error
- func (pv *ProjectionVisitor) OnExitPropertyOrLabelsExpression(e query.QueryPropertyOrLabelsExpression) error
- func (pv *ProjectionVisitor) OnVariable(name string) error
- func (pv *ProjectionVisitor) OnVariablePropertiesPath(properties []string) error
- func (pv *ProjectionVisitor) ParseExpression(q *query.QueryExpression) error
- type Querier
- type QuerierResult
- type QueryGraph
- func (qg *QueryGraph) FindVariable(name string) (TypeAndIndex, error)
- func (qg *QueryGraph) GetNodeByID(idx int) (*QueryNode, error)
- func (qg *QueryGraph) PushNode(q query.QueryNodePattern, scope Scope) (*QueryNode, int, error)
- func (qg *QueryGraph) PushRelation(q query.QueryRelationshipPattern, leftIdx, rightIdx int, scope Scope) (*QueryRelation, int, error)
- type QueryLimitVisitor
- type QueryNode
- type QueryRelation
- type QuerySkipVisitor
- type QueryWhereVisitor
- type Relation
- type RelationDirection
- type RelationKey
- type RelationWithID
- type SQLExpressionVisitor
- func (sev *SQLExpressionVisitor) OnBooleanLiteral(value bool) error
- func (sev *SQLExpressionVisitor) OnComparisonOperator(operator query.ComparisonOperator) error
- func (sev *SQLExpressionVisitor) OnDoubleLiteral(value float64) error
- func (sev *SQLExpressionVisitor) OnExitAndExpression() error
- func (sev *SQLExpressionVisitor) OnExitComparisonExpression() error
- func (sev *SQLExpressionVisitor) OnExitExpression() error
- func (sev *SQLExpressionVisitor) OnExitFunctionInvocation(name string, distinct bool) error
- func (sev *SQLExpressionVisitor) OnExitNotExpression(not bool) error
- func (sev *SQLExpressionVisitor) OnExitOrExpression() error
- func (sev *SQLExpressionVisitor) OnExitParenthesizedExpression() error
- func (sev *SQLExpressionVisitor) OnExitPropertyOrLabelsExpression(e query.QueryPropertyOrLabelsExpression) error
- func (sev *SQLExpressionVisitor) OnExitRelationshipsPattern(q query.QueryRelationshipsPattern, id int) error
- func (sev *SQLExpressionVisitor) OnExitStringListNullOperatorExpression(e query.QueryStringListNullOperatorExpression) error
- func (sev *SQLExpressionVisitor) OnIntegerLiteral(value int64) error
- func (sev *SQLExpressionVisitor) OnStringLiteral(value string) error
- func (sev *SQLExpressionVisitor) OnStringOperator(operator query.StringOperator) error
- func (sev *SQLExpressionVisitor) OnVariable(name string) error
- func (sev *SQLExpressionVisitor) OnVariablePropertiesPath(propertiesPath []string) error
- type SQLFrom
- type SQLFunction
- type SQLInnerStructure
- type SQLProjection
- type SQLQueryTranslator
- type SQLStructure
- type SQLTranslation
- type Scope
- type SourceSubGraphUpdates
- type Statistics
- type TypeAndIndex
- type VariableType
Constants ¶
This section is empty.
Variables ¶
var MatchScope = Scope{Context: MatchContext, ID: 0}
MatchScope default match scope. All patterns in the MATCH clause should have this scope.
Functions ¶
func MeasureDuration ¶
Types ¶
type AndOrExpression ¶ added in v0.0.6
type AndOrExpression struct { And bool // true for And and false for Or Children []AndOrExpression Expression string }
AndOrExpression represent a AND or OR expression
func CrossProductExpressions ¶ added in v0.0.6
func CrossProductExpressions(and1 []AndOrExpression, and2 []AndOrExpression) []AndOrExpression
CrossProductExpressions computes the cross product of 2 sets of expressions. This is used to transform OR expressions into a union of AND expressions.
func FlattenAndOrExpressions ¶ added in v0.0.54
func FlattenAndOrExpressions(tree AndOrExpression) (AndOrExpression, error)
func UnwindOrExpressions ¶ added in v0.0.6
func UnwindOrExpressions(tree AndOrExpression) ([]AndOrExpression, error)
UnwindOrExpressions in order to transform query with or relations into a union query which is more performant, an AndOrExpression is transformed into a list of AndExpressions
func (AndOrExpression) String ¶ added in v0.0.30
func (aoe AndOrExpression) String() string
type AssetWithID ¶
AssetWithID represent an asset with an ID from the database
func (AssetWithID) String ¶
func (a AssetWithID) String() string
type Cursor ¶
type Cursor interface { HasMore() bool Read(ctx context.Context, doc interface{}) error Close() error }
Cursor is a cursor over the results
type ExpressionBuilder ¶
type ExpressionBuilder struct { QueryGraph *QueryGraph // contains filtered or unexported fields }
ExpressionBuilder build a SQL part based on a Cypher expression
func NewExpressionBuilder ¶
func NewExpressionBuilder(queryGraph *QueryGraph) *ExpressionBuilder
NewExpressionBuilder create a new instance of expression builder
func (*ExpressionBuilder) Build ¶ added in v0.0.6
func (eb *ExpressionBuilder) Build(q *query.QueryExpression) (string, error)
Build the SQL expression from the Cypher expression
type ExpressionParser ¶ added in v0.0.6
type ExpressionParser struct {
// contains filtered or unexported fields
}
ExpressionParser is a parser of expression
func NewExpressionParser ¶ added in v0.0.6
func NewExpressionParser(visitor ExpressionVisitor, queryGraph *QueryGraph) *ExpressionParser
NewExpressionParser create a new instance of expression parser.
func (*ExpressionParser) ParseAddOrSubtractExpression ¶ added in v0.0.6
func (ep *ExpressionParser) ParseAddOrSubtractExpression(q *query.QueryAddOrSubtractExpression) error
ParseAddOrSubtractExpression parse add or subtract expression
func (*ExpressionParser) ParseComparisonExpression ¶ added in v0.0.6
func (ep *ExpressionParser) ParseComparisonExpression(q *query.QueryComparisonExpression) error
ParseComparisonExpression parse comparison expression
func (*ExpressionParser) ParseExpression ¶ added in v0.0.6
func (ep *ExpressionParser) ParseExpression(q *query.QueryExpression) error
ParseExpression parse expression
func (*ExpressionParser) ParseMultipleDivideModuloExpression ¶ added in v0.0.6
func (ep *ExpressionParser) ParseMultipleDivideModuloExpression(q *query.QueryMultipleDivideModuloExpression) error
ParseMultipleDivideModuloExpression parse multiple divide modulo expression
func (*ExpressionParser) ParseNotExpression ¶ added in v0.0.6
func (ep *ExpressionParser) ParseNotExpression(q *query.QueryNotExpression) error
ParseNotExpression parse not expression
func (*ExpressionParser) ParseOrExpression ¶ added in v0.0.6
func (ep *ExpressionParser) ParseOrExpression(q *query.QueryOrExpression) error
ParseOrExpression parse or expression
func (*ExpressionParser) ParsePowerOfExpression ¶ added in v0.0.6
func (ep *ExpressionParser) ParsePowerOfExpression(q *query.QueryPowerOfExpression) error
ParsePowerOfExpression parse power of expression
func (*ExpressionParser) ParsePropertyOrLabelsExpression ¶ added in v0.0.6
func (ep *ExpressionParser) ParsePropertyOrLabelsExpression(q *query.QueryPropertyOrLabelsExpression) error
ParsePropertyOrLabelsExpression parse property or labels expression
func (*ExpressionParser) ParseRelationshipsPattern ¶ added in v0.0.32
func (ep *ExpressionParser) ParseRelationshipsPattern(q *query.QueryRelationshipsPattern) error
ParseRelationshipsPattern parse a query relationships pattern
func (*ExpressionParser) ParseStringListNullOperatorExpression ¶ added in v0.0.6
func (ep *ExpressionParser) ParseStringListNullOperatorExpression(q *query.QueryStringListNullOperatorExpression) error
ParseStringListNullOperatorExpression parse string list null operator expression
func (*ExpressionParser) ParseUnaryAddOrSubtractExpression ¶ added in v0.0.6
func (ep *ExpressionParser) ParseUnaryAddOrSubtractExpression(q *query.QueryUnaryAddOrSubtractExpression) error
ParseUnaryAddOrSubtractExpression parse unary add or subtract expression
func (*ExpressionParser) ParseXorExpression ¶ added in v0.0.6
func (ep *ExpressionParser) ParseXorExpression(q *query.QueryXorExpression) error
ParseXorExpression parse xor expression
type ExpressionType ¶
type ExpressionType int
ExpressionType expression type
const ( // NodeExprType node expression type NodeExprType ExpressionType = iota // EdgeExprType edge expression type EdgeExprType ExpressionType = iota // PropertyExprType property expression type PropertyExprType ExpressionType = iota )
type ExpressionVisitor ¶ added in v0.0.6
type ExpressionVisitor interface { OnEnterPropertyOrLabelsExpression(e query.QueryPropertyOrLabelsExpression) error OnExitPropertyOrLabelsExpression(e query.QueryPropertyOrLabelsExpression) error OnEnterStringListNullOperatorExpression(e query.QueryStringListNullOperatorExpression) error OnExitStringListNullOperatorExpression(e query.QueryStringListNullOperatorExpression) error OnVariable(name string) error OnVariablePropertiesPath(propertiesPath []string) error OnStringLiteral(value string) error OnDoubleLiteral(value float64) error OnIntegerLiteral(value int64) error OnBooleanLiteral(value bool) error OnEnterFunctionInvocation(name string, distinct bool) error OnExitFunctionInvocation(name string, distinct bool) error OnEnterRelationshipsPattern(q query.QueryRelationshipsPattern, id int) error OnExitRelationshipsPattern(q query.QueryRelationshipsPattern, id int) error OnNodePattern(q query.QueryNodePattern) error OnRelationshipPattern(q query.QueryRelationshipPattern) error OnEnterParenthesizedExpression() error OnExitParenthesizedExpression() error OnStringOperator(operator query.StringOperator) error OnEnterUnaryExpression() error OnExitUnaryExpression() error OnEnterPowerOfExpression() error OnExitPowerOfExpression() error OnEnterMultipleDivideModuloExpression() error OnExitMultipleDivideModuloExpression() error OnMultiplyDivideModuloOperator(operator query.MultiplyDivideModuloOperator) error OnEnterAddOrSubtractExpression() error OnExitAddOrSubtractExpression() error OnAddOrSubtractOperator(operator query.AddOrSubtractOperator) error OnEnterComparisonExpression() error OnExitComparisonExpression() error OnComparisonOperator(operator query.ComparisonOperator) error OnEnterNotExpression(not bool) error OnExitNotExpression(not bool) error OnEnterAndExpression() error OnExitAndExpression() error OnEnterXorExpression() error OnExitXorExpression() error OnEnterOrExpression() error OnExitOrExpression() error OnEnterExpression() error OnExitExpression() error }
ExpressionVisitor a visitor of expression
type ExpressionVisitorBase ¶ added in v0.0.6
type ExpressionVisitorBase struct{}
ExpressionVisitorBase expression visitor base interface
func (*ExpressionVisitorBase) OnAddOrSubtractOperator ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnAddOrSubtractOperator(operator query.AddOrSubtractOperator) error
func (*ExpressionVisitorBase) OnBooleanLiteral ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnBooleanLiteral(value bool) error
func (*ExpressionVisitorBase) OnComparisonOperator ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnComparisonOperator(operator query.ComparisonOperator) error
func (*ExpressionVisitorBase) OnDoubleLiteral ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnDoubleLiteral(value float64) error
func (*ExpressionVisitorBase) OnEnterAddOrSubtractExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterAddOrSubtractExpression() error
func (*ExpressionVisitorBase) OnEnterAndExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterAndExpression() error
func (*ExpressionVisitorBase) OnEnterComparisonExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterComparisonExpression() error
func (*ExpressionVisitorBase) OnEnterExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterExpression() error
func (*ExpressionVisitorBase) OnEnterFunctionInvocation ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterFunctionInvocation(name string, distinct bool) error
func (*ExpressionVisitorBase) OnEnterMultipleDivideModuloExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterMultipleDivideModuloExpression() error
func (*ExpressionVisitorBase) OnEnterNotExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterNotExpression(not bool) error
func (*ExpressionVisitorBase) OnEnterOrExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterOrExpression() error
func (*ExpressionVisitorBase) OnEnterParenthesizedExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterParenthesizedExpression() error
func (*ExpressionVisitorBase) OnEnterPowerOfExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterPowerOfExpression() error
func (*ExpressionVisitorBase) OnEnterPropertyOrLabelsExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterPropertyOrLabelsExpression(e query.QueryPropertyOrLabelsExpression) error
func (*ExpressionVisitorBase) OnEnterRelationshipsPattern ¶ added in v0.0.30
func (evb *ExpressionVisitorBase) OnEnterRelationshipsPattern(q query.QueryRelationshipsPattern, id int) error
func (*ExpressionVisitorBase) OnEnterStringListNullOperatorExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterStringListNullOperatorExpression(e query.QueryStringListNullOperatorExpression) error
func (*ExpressionVisitorBase) OnEnterUnaryExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterUnaryExpression() error
func (*ExpressionVisitorBase) OnEnterXorExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnEnterXorExpression() error
func (*ExpressionVisitorBase) OnExitAddOrSubtractExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitAddOrSubtractExpression() error
func (*ExpressionVisitorBase) OnExitAndExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitAndExpression() error
func (*ExpressionVisitorBase) OnExitComparisonExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitComparisonExpression() error
func (*ExpressionVisitorBase) OnExitExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitExpression() error
func (*ExpressionVisitorBase) OnExitFunctionInvocation ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitFunctionInvocation(name string, distinct bool) error
func (*ExpressionVisitorBase) OnExitMultipleDivideModuloExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitMultipleDivideModuloExpression() error
func (*ExpressionVisitorBase) OnExitNotExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitNotExpression(not bool) error
func (*ExpressionVisitorBase) OnExitOrExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitOrExpression() error
func (*ExpressionVisitorBase) OnExitParenthesizedExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitParenthesizedExpression() error
func (*ExpressionVisitorBase) OnExitPowerOfExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitPowerOfExpression() error
func (*ExpressionVisitorBase) OnExitPropertyOrLabelsExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitPropertyOrLabelsExpression(e query.QueryPropertyOrLabelsExpression) error
func (*ExpressionVisitorBase) OnExitRelationshipsPattern ¶ added in v0.0.30
func (evb *ExpressionVisitorBase) OnExitRelationshipsPattern(q query.QueryRelationshipsPattern, id int) error
func (*ExpressionVisitorBase) OnExitStringListNullOperatorExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitStringListNullOperatorExpression(e query.QueryStringListNullOperatorExpression) error
func (*ExpressionVisitorBase) OnExitUnaryExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitUnaryExpression() error
func (*ExpressionVisitorBase) OnExitXorExpression ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnExitXorExpression() error
func (*ExpressionVisitorBase) OnIntegerLiteral ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnIntegerLiteral(value int64) error
func (*ExpressionVisitorBase) OnMultiplyDivideModuloOperator ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnMultiplyDivideModuloOperator(operator query.MultiplyDivideModuloOperator) error
func (*ExpressionVisitorBase) OnNodePattern ¶ added in v0.0.32
func (evb *ExpressionVisitorBase) OnNodePattern(q query.QueryNodePattern) error
func (*ExpressionVisitorBase) OnRelationshipPattern ¶ added in v0.0.32
func (evb *ExpressionVisitorBase) OnRelationshipPattern(q query.QueryRelationshipPattern) error
func (*ExpressionVisitorBase) OnStringLiteral ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnStringLiteral(value string) error
func (*ExpressionVisitorBase) OnStringOperator ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnStringOperator(operator query.StringOperator) error
func (*ExpressionVisitorBase) OnVariable ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnVariable(name string) error
func (*ExpressionVisitorBase) OnVariablePropertiesPath ¶ added in v0.0.6
func (evb *ExpressionVisitorBase) OnVariablePropertiesPath(propertiesPath []string) error
type FunctionInvocationContext ¶ added in v0.0.54
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph represent a Graph
func (*Graph) AddRelation ¶
func (g *Graph) AddRelation(from AssetKey, relationType schema.RelationKeyType, to AssetKey) Relation
AddRelation add a relation to the graph
func (*Graph) ExtractSchema ¶
func (g *Graph) ExtractSchema() schema.SchemaGraph
ExtractSchema extract the schema from the graph
func (*Graph) HasRelation ¶
HasRelation return true if the relation is in the graph, false otherwise.
func (*Graph) MarshalJSON ¶
MarshalJSON marshall the graph in JSON
func (*Graph) UnmarshalJSON ¶
UnmarshalJSON unmarshal a graph from JSON
type GraphBinder ¶
type GraphBinder struct {
// contains filtered or unexported fields
}
GraphBinder represent a graph builder which bind assets and relations to graph schema provided by the source
func NewGraphBinder ¶
func NewGraphBinder(graph *Graph) *GraphBinder
NewGraphBinder create an instance of graph binder
func (*GraphBinder) Bind ¶
func (gb *GraphBinder) Bind(asset string, assetType schema.AssetType)
Bind bind one asset to a type
func (*GraphBinder) Relate ¶
func (gb *GraphBinder) Relate(from string, relationType schema.RelationType, to string)
Relate relate one asset to another
type GraphDB ¶
type GraphDB interface { Close() error InitializeSchema() error ReadGraph(ctx context.Context, sourceName string, encoder *GraphEncoder) error // Atomic operations on the graph InsertAssets(ctx context.Context, sourceName string, assets []Asset) error InsertRelations(ctx context.Context, sourceName string, relations []Relation) error RemoveAssets(ctx context.Context, sourceName string, assets []Asset) error RemoveRelations(ctx context.Context, sourceName string, relations []Relation) error GetAssetSources(ctx context.Context, ids []string) (map[string][]string, error) GetRelationSources(ctx context.Context, ids []string) (map[string][]string, error) FlushAll(ctx context.Context) error CountAssets(ctx context.Context) (int64, error) CountAssetsBySource(ctx context.Context, sourceName string) (int64, error) CountRelations(ctx context.Context) (int64, error) CountRelationsBySource(ctx context.Context, sourceName string) (int64, error) Query(ctx context.Context, query SQLTranslation) (*GraphQueryResult, error) // Collect some metrics about the database CollectMetrics(ctx context.Context) (map[string]int, error) }
GraphDB an interface to a graph DB such as Arango or neo4j
type GraphDecoder ¶ added in v0.0.50
type GraphDecoder struct {
// contains filtered or unexported fields
}
GraphDecoder represent a graph decoder
func NewGraphDecoder ¶ added in v0.0.50
func NewGraphDecoder(r io.Reader) *GraphDecoder
NewGraphDecoder create an instance of a graph encoder
func (*GraphDecoder) Decode ¶ added in v0.0.50
func (ge *GraphDecoder) Decode(graph *Graph) error
Decode decode a graph
type GraphEncoder ¶ added in v0.0.50
type GraphEncoder struct {
// contains filtered or unexported fields
}
GraphEncoder represent a graph encoder
func NewGraphEncoder ¶ added in v0.0.50
func NewGraphEncoder(w io.Writer) *GraphEncoder
NewGraphEncoder create an instance of a graph encoder
func (*GraphEncoder) EncodeAsset ¶ added in v0.0.50
func (ge *GraphEncoder) EncodeAsset(asset Asset) error
EncodeAsset encode an asset
func (*GraphEncoder) EncodeRelation ¶ added in v0.0.50
func (ge *GraphEncoder) EncodeRelation(relation Relation) error
EncodeRelation encode a relation
type GraphQueryResult ¶
type GraphQueryResult struct { Cursor Cursor Projections []Projection }
GraphQueryResult represent a result from the database with the projection model
type GraphUpdater ¶
type GraphUpdater struct {
// contains filtered or unexported fields
}
GraphUpdater represents the updater of graph
func NewGraphUpdater ¶
func NewGraphUpdater(graphDB GraphDB, schemaPersistor schema.Persistor) *GraphUpdater
NewGraphUpdater create a new instance of graph updater
func (*GraphUpdater) InsertAssets ¶ added in v0.0.25
InsertAssets insert multiple assets in the graph of the data source
func (*GraphUpdater) InsertRelations ¶ added in v0.0.25
func (sl *GraphUpdater) InsertRelations(ctx context.Context, source string, relations []Relation) error
InsertRelations insert multiple relations in the graph of the data source
func (*GraphUpdater) RemoveAssets ¶ added in v0.0.25
RemoveAssets remove multiple assets from the graph of the data source
func (*GraphUpdater) RemoveRelations ¶ added in v0.0.25
func (sl *GraphUpdater) RemoveRelations(ctx context.Context, source string, relations []Relation) error
RemoveRelations remove multiple relations from the graph of the data source
func (*GraphUpdater) UpdateSchema ¶ added in v0.0.17
func (sl *GraphUpdater) UpdateSchema(ctx context.Context, source string, sg schema.SchemaGraph) error
UpdateSchema update the schema for the source with the one provided in the request
type GraphUpdatesBulk ¶
type GraphUpdatesBulk struct {
// contains filtered or unexported fields
}
GraphUpdatesBulk represent a bulk of asset and relation updates to perform on the graph
func GenerateGraphUpdatesBulk ¶
func GenerateGraphUpdatesBulk(previousGraph *Graph, newGraph *Graph) *GraphUpdatesBulk
GenerateGraphUpdatesBulk generate a graph update bulk by taking the difference between new graph and previous graph. It means the updates would transform previous graph into new graph.
func NewGraphUpdatesBulk ¶
func NewGraphUpdatesBulk() *GraphUpdatesBulk
NewGraphUpdatesBulk create an instance of graph updates
func (*GraphUpdatesBulk) GetAssetRemovals ¶
func (gub *GraphUpdatesBulk) GetAssetRemovals() []Asset
GetAssetRemovals retrieve all assets to be removed
func (*GraphUpdatesBulk) GetAssetUpserts ¶
func (gub *GraphUpdatesBulk) GetAssetUpserts() []Asset
GetAssetUpserts retrieve the list of all assets to be upsered
func (*GraphUpdatesBulk) GetRelationRemovals ¶
func (gub *GraphUpdatesBulk) GetRelationRemovals() []Relation
GetRelationRemovals retrieve all relations to be removed
func (*GraphUpdatesBulk) GetRelationUpserts ¶
func (gub *GraphUpdatesBulk) GetRelationUpserts() []Relation
GetRelationUpserts retrieve all relations to be upserted
func (*GraphUpdatesBulk) HasAssetRemoval ¶
func (gub *GraphUpdatesBulk) HasAssetRemoval(asset Asset) bool
HasAssetRemoval check whether this asset need to be removed
func (*GraphUpdatesBulk) HasAssetUpsert ¶
func (gub *GraphUpdatesBulk) HasAssetUpsert(asset Asset) bool
HasAssetUpsert check whether asset needs to be upserted
func (*GraphUpdatesBulk) HasRelationRemoval ¶
func (gub *GraphUpdatesBulk) HasRelationRemoval(relation Relation) bool
HasRelationRemoval check whether the bulk contains the removal of this relation
func (*GraphUpdatesBulk) HasRelationUpsert ¶
func (gub *GraphUpdatesBulk) HasRelationUpsert(relation Relation) bool
HasRelationUpsert check whether the relation needs to be upserted
func (*GraphUpdatesBulk) MarshalJSON ¶
func (gub *GraphUpdatesBulk) MarshalJSON() ([]byte, error)
MarshalJSON marshal a graph update bulk
func (*GraphUpdatesBulk) RemoveAsset ¶
func (gub *GraphUpdatesBulk) RemoveAsset(asset Asset)
RemoveAsset create an operation to remove an asset
func (*GraphUpdatesBulk) RemoveAssets ¶
func (gub *GraphUpdatesBulk) RemoveAssets(assets ...Asset)
RemoveAssets create multiple asset removal operations
func (*GraphUpdatesBulk) RemoveRelation ¶
func (gub *GraphUpdatesBulk) RemoveRelation(relation Relation)
RemoveRelation create an operation to remove a relation
func (*GraphUpdatesBulk) RemoveRelations ¶
func (gub *GraphUpdatesBulk) RemoveRelations(relations ...Relation)
RemoveRelations create multiple relation removal operations
func (*GraphUpdatesBulk) UnmarshalJSON ¶
func (gub *GraphUpdatesBulk) UnmarshalJSON(bytes []byte) error
UnmarshalJSON unmarshal a graph updates bulk
func (*GraphUpdatesBulk) UpsertAsset ¶
func (gub *GraphUpdatesBulk) UpsertAsset(asset Asset)
UpsertAsset create an operation to upsert an asset
func (*GraphUpdatesBulk) UpsertAssets ¶
func (gub *GraphUpdatesBulk) UpsertAssets(assets ...Asset)
UpsertAssets append multiple assets to upsert
func (*GraphUpdatesBulk) UpsertRelation ¶
func (gub *GraphUpdatesBulk) UpsertRelation(relation Relation)
UpsertRelation create an operation to upsert an relation
func (*GraphUpdatesBulk) UpsertRelations ¶
func (gub *GraphUpdatesBulk) UpsertRelations(relations ...Relation)
UpsertRelations create multiple relation upsert operations
type GraphUpdatesBulkJSON ¶
type GraphUpdatesBulkJSON struct { AssetUpserts []Asset `json:"asset_upserts"` AssetRemovals []Asset `json:"asset_removals"` RelationUpserts []Relation `json:"relation_upserts"` RelationRemovals []Relation `json:"relation_removals"` }
GraphUpdatesBulkJSON represent a bulk in JSON form
type GraphUpdatesQueue ¶ added in v0.0.17
type GraphUpdatesQueue struct {
// contains filtered or unexported fields
}
GraphUpdatesQueue represent a graph updates queue with
func NewGraphUpdatesQueue ¶ added in v0.0.17
func NewGraphUpdatesQueue(length int) *GraphUpdatesQueue
NewGraphUpdatesQueue create a new instance of updates queue
func (*GraphUpdatesQueue) Dequeue ¶ added in v0.0.17
func (guq *GraphUpdatesQueue) Dequeue() (*SourceSubGraphUpdates, error)
Dequeue an item from the queue
func (*GraphUpdatesQueue) Dispose ¶ added in v0.0.17
func (guq *GraphUpdatesQueue) Dispose()
Dispose will dispose of this queue. Any subsequent calls to Get or Put will return an error.
func (*GraphUpdatesQueue) Enqueue ¶ added in v0.0.17
func (guq *GraphUpdatesQueue) Enqueue(update SourceSubGraphUpdates) error
Enqueue an item into the queue
func (*GraphUpdatesQueue) IsFull ¶ added in v0.0.17
func (guq *GraphUpdatesQueue) IsFull() bool
IsFull check if the queue is full
type PatternContext ¶ added in v0.0.31
type PatternContext int
PatternContext the context of the pattern pushed
const ( // MatchContext the node or relation is coming from a MATCH clause MatchContext PatternContext = iota // WhereContext the node or relation is coming from a WHERE clause WhereContext PatternContext = iota )
type PatternParser ¶ added in v0.0.30
type PatternParser struct {
// contains filtered or unexported fields
}
PatternParser is a parser of patterns
func NewPatternParser ¶ added in v0.0.30
func NewPatternParser(queryGraph *QueryGraph) *PatternParser
NewPatternParser create an instance of pattern parser
func (*PatternParser) ParsePatternElement ¶ added in v0.0.30
func (ep *PatternParser) ParsePatternElement(q *query.QueryPatternElement, scope Scope) error
ParsePatternElement parse a pattern element
func (*PatternParser) ParseRelationshipsPattern ¶ added in v0.0.30
func (ep *PatternParser) ParseRelationshipsPattern(q *query.QueryRelationshipsPattern, scope Scope) error
ParseRelationshipsPattern parse a relationships pattern
type Projection ¶
type Projection struct { Alias string ExpressionType ExpressionType }
Projection represent the type and alias of one item in the RETURN statement (called a projection).
type ProjectionItem ¶ added in v0.0.54
type ProjectionVisitor ¶ added in v0.0.6
type ProjectionVisitor struct { ExpressionVisitorBase Aggregation bool TypeAndIndex TypeAndIndex ExpressionType ExpressionType Projections []ProjectionItem // contains filtered or unexported fields }
func NewProjectionVisitor ¶ added in v0.0.30
func NewProjectionVisitor(queryGraph *QueryGraph) *ProjectionVisitor
func (*ProjectionVisitor) OnEnterFunctionInvocation ¶ added in v0.0.6
func (pv *ProjectionVisitor) OnEnterFunctionInvocation(name string, distinct bool) error
OnExitFunctionInvocation called when the ExitFunctionInvocation is parsed. Name is the name of the function.
func (*ProjectionVisitor) OnExitFunctionInvocation ¶ added in v0.0.54
func (pv *ProjectionVisitor) OnExitFunctionInvocation(name string, distinct bool) error
OnExitFunctionInvocation called when the ExitFunctionInvocation is parsed. Name is the name of the function.
func (*ProjectionVisitor) OnExitPropertyOrLabelsExpression ¶ added in v0.0.6
func (pv *ProjectionVisitor) OnExitPropertyOrLabelsExpression(e query.QueryPropertyOrLabelsExpression) error
func (*ProjectionVisitor) OnVariable ¶ added in v0.0.6
func (pv *ProjectionVisitor) OnVariable(name string) error
func (*ProjectionVisitor) OnVariablePropertiesPath ¶ added in v0.0.6
func (pv *ProjectionVisitor) OnVariablePropertiesPath(properties []string) error
func (*ProjectionVisitor) ParseExpression ¶ added in v0.0.6
func (pv *ProjectionVisitor) ParseExpression(q *query.QueryExpression) error
ParseExpression return whether the expression require aggregation
type Querier ¶
type Querier struct { GraphDB GraphDB // contains filtered or unexported fields }
func NewQuerier ¶
func NewQuerier(db GraphDB, historizer history.Historizer) *Querier
NewQuerier create an instance of a querier
type QuerierResult ¶
type QuerierResult struct { Cursor Cursor Projections []Projection Statistics Statistics }
type QueryGraph ¶ added in v0.0.6
type QueryGraph struct { Nodes []QueryNode Relations []QueryRelation VariablesIndex map[string]TypeAndIndex }
QueryGraph the representation of a query graph. This structure helps create the relations between nodes to facilitate SQL translation and projections
func NewQueryGraph ¶ added in v0.0.6
func NewQueryGraph() QueryGraph
NewQueryGraph create an instance of a query graph
func (*QueryGraph) FindVariable ¶ added in v0.0.6
func (qg *QueryGraph) FindVariable(name string) (TypeAndIndex, error)
FindVariable find a variable by its name
func (*QueryGraph) GetNodeByID ¶ added in v0.0.31
func (qg *QueryGraph) GetNodeByID(idx int) (*QueryNode, error)
GetNodeByID get a node by its id
func (*QueryGraph) PushNode ¶ added in v0.0.6
func (qg *QueryGraph) PushNode(q query.QueryNodePattern, scope Scope) (*QueryNode, int, error)
PushNode push a node into the registry
func (*QueryGraph) PushRelation ¶ added in v0.0.6
func (qg *QueryGraph) PushRelation(q query.QueryRelationshipPattern, leftIdx, rightIdx int, scope Scope) (*QueryRelation, int, error)
PushRelation push a relation into the registry
type QueryLimitVisitor ¶ added in v0.0.6
type QueryLimitVisitor struct { ExpressionVisitorBase Limit int64 // contains filtered or unexported fields }
QueryLimitVisitor a visitor for the limit clause
func NewQueryLimitVisitor ¶ added in v0.0.30
func NewQueryLimitVisitor(queryGraph *QueryGraph) *QueryLimitVisitor
NewQueryLimitVisitor create an instance of query limit visitor
func (*QueryLimitVisitor) OnIntegerLiteral ¶ added in v0.0.6
func (qlv *QueryLimitVisitor) OnIntegerLiteral(value int64) error
OnIntegerLiteral handler called when an integer literal is visited
func (*QueryLimitVisitor) ParseExpression ¶ added in v0.0.6
func (qlv *QueryLimitVisitor) ParseExpression(q *query.QueryExpression) error
ParseExpression return whether the expression require aggregation
type QueryNode ¶
type QueryNode struct { Labels []string // Constraint expressions Constraints AndOrExpression // The scopes this node belongs to (MATCH or WHERE) Scopes map[Scope]struct{} }
QueryNode represent a node and its constraints
type QueryRelation ¶
type QueryRelation struct { Labels []string // Constraint expressions Constraints AndOrExpression LeftIdx int RightIdx int Direction RelationDirection // The scopes this relations belongs to (MATCH or WHERE) Scopes map[Scope]struct{} }
QueryRelation represent a relation and its constraints
type QuerySkipVisitor ¶ added in v0.0.6
type QuerySkipVisitor struct { ExpressionVisitorBase Skip int64 // contains filtered or unexported fields }
QuerySkipVisitor a visitor for the skip clause
func NewQuerySkipVisitor ¶ added in v0.0.30
func NewQuerySkipVisitor(queryGraph *QueryGraph) *QuerySkipVisitor
NewQuerySkipVisitor create an instance of the skip visitor
func (*QuerySkipVisitor) OnIntegerLiteral ¶ added in v0.0.6
func (qsv *QuerySkipVisitor) OnIntegerLiteral(value int64) error
OnIntegerLiteral handler called when an integer literal is visited
func (*QuerySkipVisitor) ParseExpression ¶ added in v0.0.6
func (qsv *QuerySkipVisitor) ParseExpression(q *query.QueryExpression) error
ParseExpression return whether the expression require aggregation
type QueryWhereVisitor ¶ added in v0.0.6
type QueryWhereVisitor struct { ExpressionVisitorBase Variables []string // contains filtered or unexported fields }
QueryWhereVisitor a visitor for the where clauses
func NewQueryWhereVisitor ¶ added in v0.0.30
func NewQueryWhereVisitor(queryGraph *QueryGraph) *QueryWhereVisitor
NewQueryWhereVisitor create an instance of query where visitor.
func (*QueryWhereVisitor) OnVariable ¶ added in v0.0.6
func (qwv *QueryWhereVisitor) OnVariable(name string) error
OnVariable handler called when a variable is visited in the where clause
func (*QueryWhereVisitor) ParseExpression ¶ added in v0.0.6
func (qwv *QueryWhereVisitor) ParseExpression(q *query.QueryExpression) (string, error)
ParseExpression return whether the expression require aggregation
type RelationDirection ¶ added in v0.0.6
type RelationDirection int
RelationDirection the direction of a relation
const ( // Left relation Left RelationDirection = iota // Right relation Right RelationDirection = iota // Either there is a relation but we don't know in which direction Either RelationDirection = iota // Both there is a relation in both directions Both RelationDirection = iota )
type RelationKey ¶
type RelationKey struct { Type schema.RelationKeyType `json:"type"` From AssetKey `json:"from"` To AssetKey `json:"to"` }
RelationKey a relation key of the KB
type RelationWithID ¶
type RelationWithID struct { ID string `json:"_id"` From string `json:"from_id"` To string `json:"to_id"` Type schema.RelationKeyType `json:"type"` }
RelationWithID represent a relation with an ID from the database
func (RelationWithID) String ¶
func (r RelationWithID) String() string
type SQLExpressionVisitor ¶ added in v0.0.6
type SQLExpressionVisitor struct { ExpressionVisitorBase // contains filtered or unexported fields }
SQLExpressionVisitor visitor used to build the SQL part from the Cypher expression.
func (*SQLExpressionVisitor) OnBooleanLiteral ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnBooleanLiteral(value bool) error
func (*SQLExpressionVisitor) OnComparisonOperator ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnComparisonOperator(operator query.ComparisonOperator) error
func (*SQLExpressionVisitor) OnDoubleLiteral ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnDoubleLiteral(value float64) error
func (*SQLExpressionVisitor) OnExitAndExpression ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnExitAndExpression() error
func (*SQLExpressionVisitor) OnExitComparisonExpression ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnExitComparisonExpression() error
func (*SQLExpressionVisitor) OnExitExpression ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnExitExpression() error
func (*SQLExpressionVisitor) OnExitFunctionInvocation ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnExitFunctionInvocation(name string, distinct bool) error
OnExitFunctionInvocation build the SQL snippet calling the function
func (*SQLExpressionVisitor) OnExitNotExpression ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnExitNotExpression(not bool) error
func (*SQLExpressionVisitor) OnExitOrExpression ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnExitOrExpression() error
func (*SQLExpressionVisitor) OnExitParenthesizedExpression ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnExitParenthesizedExpression() error
func (*SQLExpressionVisitor) OnExitPropertyOrLabelsExpression ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnExitPropertyOrLabelsExpression(e query.QueryPropertyOrLabelsExpression) error
func (*SQLExpressionVisitor) OnExitRelationshipsPattern ¶ added in v0.0.32
func (sev *SQLExpressionVisitor) OnExitRelationshipsPattern(q query.QueryRelationshipsPattern, id int) error
OnExitRelationshipsPattern build the SQL query that will be put in the EXIST clause
func (*SQLExpressionVisitor) OnExitStringListNullOperatorExpression ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnExitStringListNullOperatorExpression(e query.QueryStringListNullOperatorExpression) error
func (*SQLExpressionVisitor) OnIntegerLiteral ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnIntegerLiteral(value int64) error
func (*SQLExpressionVisitor) OnStringLiteral ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnStringLiteral(value string) error
func (*SQLExpressionVisitor) OnStringOperator ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnStringOperator(operator query.StringOperator) error
func (*SQLExpressionVisitor) OnVariable ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnVariable(name string) error
func (*SQLExpressionVisitor) OnVariablePropertiesPath ¶ added in v0.0.6
func (sev *SQLExpressionVisitor) OnVariablePropertiesPath(propertiesPath []string) error
type SQLFunction ¶ added in v0.0.54
type SQLInnerStructure ¶ added in v0.0.54
type SQLInnerStructure struct { // If alias is empty there won't be any aliasing with AS keyword. Alias string Structure SQLStructure }
SQLInnerStructure represent a SQL inner structure with an optional alias name
type SQLProjection ¶ added in v0.0.54
type SQLProjection struct { // If alias is empty there won't be any aliasing with AS keyword. Alias string Variable string // If function is not empty, variable should be provided and then the SQL expression should be <Function>(<Variable>) AS <Alias> Function *SQLFunction }
SQLProjection represent a projection item with an optional alias name
type SQLQueryTranslator ¶
type SQLQueryTranslator struct {
QueryGraph QueryGraph
}
SQLQueryTranslator represent an SQL translator object converting cypher queries into SQL
func NewSQLQueryTranslator ¶
func NewSQLQueryTranslator() *SQLQueryTranslator
NewSQLQueryTranslator create an instance of SQL query translator
func (*SQLQueryTranslator) Translate ¶
func (sqt *SQLQueryTranslator) Translate(query *query.QueryCypher) (*SQLTranslation, error)
Translate a Cypher query into a SQL model
type SQLStructure ¶ added in v0.0.54
type SQLStructure struct { Distinct bool Projections []SQLProjection FromEntries []SQLFrom FromStructures []SQLInnerStructure WhereExpression AndOrExpression GroupByIndices []int Limit int Offset int }
SQLStructure represent a SQL structure for building the query string
type SQLTranslation ¶
type SQLTranslation struct { // Query is the SQL query built from the Cypher query Query string // ProjectionTypes helps the clients know how to serialize the results ProjectionTypes []Projection }
SQLTranslation the resulting object of the translation
type Scope ¶ added in v0.0.31
type Scope struct { Context PatternContext ID int }
Scope represent the context of the pattern and the ID. This is useful to know wether the pattern comes from the MATCH clause or a WHERE clause.
type SourceSubGraphUpdates ¶
type SourceSubGraphUpdates struct { Updates GraphUpdatesBulk Schema schema.SchemaGraph Source string }
SourceSubGraphUpdates represents the updates to perform on a source subgraph
type TypeAndIndex ¶ added in v0.0.6
type TypeAndIndex struct { Type VariableType Index int }
TypeAndIndex type and index of a variable from the cypher query
type VariableType ¶ added in v0.0.6
type VariableType int
VariableType represent the type of a variable in the cypher query.
const ( // NodeType variable of type node NodeType VariableType = iota // RelationType variable of type relation RelationType VariableType = iota )
Source Files
¶
- graph.go
- graph_binder.go
- graph_encoder_decoder.go
- graph_updater.go
- graph_updates.go
- graph_updates_queue.go
- graphdb.go
- querier.go
- query_and_or_expression.go
- query_expression_builder.go
- query_expression_parser.go
- query_expression_visitor.go
- query_expression_visitor_base.go
- query_graph.go
- query_limit_visitor.go
- query_pattern_parser.go
- query_projection_visitor.go
- query_skip_visitor.go
- query_sql.go
- query_where_visitor.go
- sql_builder.go