Documentation
¶
Index ¶
- Constants
- func AddSpecialFields(v *gdbi.Vertex) any
- func DstEdgeKey(eid, src, dst, label string) []byte
- func DstEdgeKeyParse(key []byte) (eid string, sid string, did string, label string)
- func DstEdgeListPrefix() []byte
- func DstEdgePrefix(id string) []byte
- func EdgeKey(id, src, dst, label string) []byte
- func EdgeKeyParse(key []byte) (eid string, sid string, did string, label string)
- func EdgeKeyPrefix(id string) []byte
- func EdgeListPrefix() []byte
- func GridsOptimizer(pipe []*gripql.GraphStatement) []*gripql.GraphStatement
- func MatchesHasExpression(val any, stmt *gripql.HasExpression) bool
- func NewGraphDB(baseDir string) (gdbi.GraphDB, error)
- func SrcEdgeKey(eid, src, dst, label string) []byte
- func SrcEdgeKeyParse(key []byte) (eid string, sid string, did string, label string)
- func SrcEdgeListPrefix() []byte
- func SrcEdgePrefix(id string) []byte
- func VertexKey(id string) []byte
- func VertexKeyParse(key []byte) (id string)
- func VertexListPrefix() []byte
- type GDB
- func (kgraph *GDB) AddGraph(graph string) error
- func (ma *GDB) BuildSchema(ctx context.Context, graph string, sampleN uint32, random bool) (*gripql.Graph, error)
- func (kgraph *GDB) Close() error
- func (kgraph *GDB) DeleteGraph(graph string) error
- func (kgraph *GDB) Graph(graph string) (gdbi.GraphInterface, error)
- func (gdb *GDB) ListGraphs() []string
- type Graph
- func (ggraph *Graph) AddEdge(edges []*gdbi.Edge) error
- func (ggraph *Graph) AddVertex(vertices []*gdbi.Vertex) error
- func (ggraph *Graph) AddVertexIndex(label, field string) error
- func (ggraph *Graph) BulkAdd(stream <-chan *gdbi.GraphElement) error
- func (ggraph *Graph) BulkDel(data *gdbi.DeleteData) error
- func (g *Graph) Close() error
- func (ggraph *Graph) Compiler() gdbi.Compiler
- func (ggraph *Graph) DelEdge(eid string) error
- func (ggraph *Graph) DelVertex(id string) error
- func (ggraph *Graph) DeleteAnyRow(id string, label string, edgeFlag bool) error
- func (ggraph *Graph) DeleteVertexIndex(label, field string) error
- func (ggraph *Graph) GetEdge(id string, loadProp bool) *gdbi.Edge
- func (ggraph *Graph) GetEdgeList(ctx context.Context, loadProp bool) <-chan *gdbi.Edge
- func (ggraph *Graph) GetInChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (ggraph *Graph) GetInEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (ggraph *Graph) GetOutChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (ggraph *Graph) GetOutEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (ggraph *Graph) GetTimestamp() string
- func (ggraph *Graph) GetVertex(id string, loadProp bool) *gdbi.Vertex
- func (ggraph *Graph) GetVertexChannel(ctx context.Context, ids chan gdbi.ElementLookup, load bool) chan gdbi.ElementLookup
- func (ggraph *Graph) GetVertexIndexList() <-chan *gripql.IndexID
- func (ggraph *Graph) GetVertexList(ctx context.Context, loadProp bool) <-chan *gdbi.Vertex
- func (ggraph *Graph) ListEdgeLabels() ([]string, error)
- func (ggraph *Graph) ListVertexLabels() ([]string, error)
- func (ggraph *Graph) VertexLabelScan(ctx context.Context, label string) chan string
- type GripQLFilter
- type OptimizationRule
Constants ¶
const ( VTABLE_PREFIX = "v_" ETABLE_PREFIX = "e_" )
Variables ¶
This section is empty.
Functions ¶
func AddSpecialFields ¶
func DstEdgeKey ¶
DstEdgeKey creates a dest edge index key
func DstEdgeKeyParse ¶
func DstEdgeListPrefix ¶
func DstEdgeListPrefix() []byte
DstEdgeListPrefix returns a byte array prefix for all entries in the dest edge index for a graph
func DstEdgePrefix ¶
DstEdgePrefix returns a byte array prefix for all entries in the dest edge index a particular vertex (the dest vertex)
func EdgeKeyParse ¶
func EdgeKeyPrefix ¶
EdgeKeyPrefix returns the byte array prefix for a particular edge id
func EdgeListPrefix ¶
func EdgeListPrefix() []byte
EdgeListPrefix returns a byte array prefix for all edges in a graph
func GridsOptimizer ¶
func GridsOptimizer(pipe []*gripql.GraphStatement) []*gripql.GraphStatement
func MatchesHasExpression ¶
func MatchesHasExpression(val any, stmt *gripql.HasExpression) bool
func NewGraphDB ¶
NewKVGraphDB intitalize a new grids graph driver
func SrcEdgeKey ¶
SrcEdgeKey creates a src edge index key
func SrcEdgeKeyParse ¶
func SrcEdgeListPrefix ¶
func SrcEdgeListPrefix() []byte
SrcEdgeListPrefix returns a byte array prefix for all entries in the source edge index for a graph
func SrcEdgePrefix ¶
SrcEdgePrefix returns a byte array prefix for all entries in the source edge index a particular vertex (the source vertex)
func VertexKeyParse ¶
func VertexListPrefix ¶
func VertexListPrefix() []byte
VertexListPrefix returns a byte array prefix for all vertices in a graph
Types ¶
type GDB ¶
type GDB struct {
// contains filtered or unexported fields
}
GridsGDB implements the GripInterface using a generic key/value storage driver
func (*GDB) BuildSchema ¶
func (ma *GDB) BuildSchema(ctx context.Context, graph string, sampleN uint32, random bool) (*gripql.Graph, error)
BuildSchema returns the schema of a specific graph in the database
func (*GDB) DeleteGraph ¶
Since each graph has its own directory, delete the directory to delete the graph
func (*GDB) Graph ¶
func (kgraph *GDB) Graph(graph string) (gdbi.GraphInterface, error)
Graph obtains the gdbi.DBI for a particular graph
func (*GDB) ListGraphs ¶
ListGraphs lists the graphs managed by this driver
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph implements the GDB interface using a genertic key/value storage driver
func (*Graph) AddEdge ¶
AddEdge adds an edge to the graph, if the id is not "" and in already exists in the graph, it is replaced
func (*Graph) AddVertex ¶
AddVertex adds an edge to the graph, if it already exists in the graph, it is replaced
func (*Graph) AddVertexIndex ¶
AddVertexIndex add index to vertices
func (*Graph) BulkDel ¶
func (ggraph *Graph) BulkDel(data *gdbi.DeleteData) error
New Bulk Delete Function. Testing... BulkDel deletes vertices and edges in bulk.
func (*Graph) DeleteAnyRow ¶
func (*Graph) DeleteVertexIndex ¶
DeleteVertexIndex delete index from vertices
func (*Graph) GetEdgeList ¶
GetEdgeList produces a channel of all edges in the graph
func (*Graph) GetInChannel ¶
func (ggraph *Graph) GetInChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetInChannel process requests of vertex ids and find the connected vertices on incoming edges
func (*Graph) GetInEdgeChannel ¶
func (ggraph *Graph) GetInEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetInEdgeChannel process requests of vertex ids and find the connected incoming edges
func (*Graph) GetOutChannel ¶
func (ggraph *Graph) GetOutChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetOutChannel process requests of vertex ids and find the connected vertices on outgoing edges
func (*Graph) GetOutEdgeChannel ¶
func (ggraph *Graph) GetOutEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetOutEdgeChannel process requests of vertex ids and find the connected outgoing edges
func (*Graph) GetTimestamp ¶
GetTimestamp returns the update timestamp
func (*Graph) GetVertexChannel ¶
func (ggraph *Graph) GetVertexChannel(ctx context.Context, ids chan gdbi.ElementLookup, load bool) chan gdbi.ElementLookup
func (*Graph) GetVertexIndexList ¶
GetVertexIndexList lists out all the vertex indices for a graph
func (*Graph) GetVertexList ¶
GetVertexList produces a channel of all edges in the graph
func (*Graph) ListEdgeLabels ¶
ListEdgeLabels returns a list of edge types in the graph
func (*Graph) ListVertexLabels ¶
ListVertexLabels returns a list of vertex types in the graph
type GripQLFilter ¶
type GripQLFilter struct {
Expression *gripql.HasExpression
}
func (*GripQLFilter) GetFilter ¶
func (f *GripQLFilter) GetFilter() any
func (*GripQLFilter) IsNoOp ¶
func (f *GripQLFilter) IsNoOp() bool
func (*GripQLFilter) Matches ¶
func (f *GripQLFilter) Matches(row any) bool
func (*GripQLFilter) RequiredFields ¶
func (f *GripQLFilter) RequiredFields() []string
type OptimizationRule ¶
type OptimizationRule struct {
Match func(pipe []*gripql.GraphStatement) bool
Replace func(pipe []*gripql.GraphStatement) []*gripql.GraphStatement
}