Documentation ¶
Overview ¶
Package quick is used for when you want to execute queries to the graph database without having to use a Grammes client.
Although more convenient at times; this package does perform slower than the typical Grammes client due to the extra checks each function needs to do for checking if it has a client to the given connection address.
Index ¶
- func AddAPIVertex(host string, data grammes.APIData) (grammes.Vertex, error)
- func AddEdgeLabel(multi multiplicity.Multiplicity, host, label string) (interface{}, error)
- func AddEdgeLabels(host string, multiplicityAndLabels ...interface{}) ([]interface{}, error)
- func AddPropertyKey(host, propertyName string, datatype datatype.DataType, ...) (interface{}, error)
- func AddVertex(host, label string, properties ...interface{}) (grammes.Vertex, error)
- func AddVertexByQuery(host string, q query.Query) (grammes.Vertex, error)
- func AddVertexByStruct(host string, vertex grammes.Vertex) (grammes.Vertex, error)
- func AddVertexLabels(host string, labels ...string) ([]grammes.Vertex, error)
- func AllVertices(host string) ([]grammes.Vertex, error)
- func CommitSchema(host string) ([][]byte, error)
- func CustomTraversal(q string) traversal.String
- func DropAll(host string) error
- func DropVertexByID(host string, ids ...interface{}) error
- func DropVertexLabel(host, label string) error
- func DropVerticesByQuery(host string, q query.Query) error
- func ExecuteQuery(host string, query query.Query) ([][]byte, error)
- func ExecuteStringQuery(host, query string) ([][]byte, error)
- func SetLogger(newLogger logging.Logger)
- func SetVertexProperty(host string, id interface{}, properties ...interface{}) error
- func Traversal() traversal.String
- func VerboseTraversal() graph.String
- func VertexByID(host string, id interface{}) (grammes.Vertex, error)
- func VertexCount(host string) (int64, error)
- func VertexIDs(host, label string, properties ...interface{}) ([]interface{}, error)
- func VertexIDsByQuery(host string, q query.Query) ([]interface{}, error)
- func Vertices(host, label string, properties ...interface{}) ([]grammes.Vertex, error)
- func VerticesByQuery(host string, q query.Query) ([]grammes.Vertex, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAPIVertex ¶
AddAPIVertex will add a vertex to the graph belonging to the given host with the API object. This API object can be used like a normal vertex in case you'd rather make a vertex through a structured format rather than a gremlin command.
func AddEdgeLabel ¶
func AddEdgeLabel(multi multiplicity.Multiplicity, host, label string) (interface{}, error)
AddEdgeLabel adds the edge label to the graph directly. This method returns the schema id of the edge label added.
func AddEdgeLabels ¶
AddEdgeLabels does the same thing as AddEdgeLabel but with the ability to do multiple labels at a time. This function is called similarly to your favorite logger.
func AddPropertyKey ¶
func AddPropertyKey(host, propertyName string, datatype datatype.DataType, cardinality cardinality.Cardinality) (interface{}, error)
AddPropertyKey adds the edge label to the graph directly. This method returns the schema id of the edge label added.
func AddVertex ¶
AddVertex will add a vertex label to the graph that is associated with the given host.
func AddVertexByQuery ¶
AddVertexByQuery takes a query and returns an added Vertex by turning it into a string.
func AddVertexByStruct ¶
AddVertexByStruct will take a Vertex struct and create a new vertex out of it in the Gremlin server. The only exception is that you cannot manually set the ID.
func AddVertexLabels ¶
AddVertexLabels will do the same as AddVertexLabel, but with the ability to add multiple labels at a time.
func AllVertices ¶
AllVertices will query the gremlin server for all of the vertices on the graph and store them into a structured format for an easier way to interact with the data.
func CommitSchema ¶
CommitSchema will take all of your schema changes and apply them to the schema once they are ready.
func CustomTraversal ¶
CustomTraversal is have a custom prefix for your traversal.
func DropVertexByID ¶
DropVertexByID will search for vertices with the provided IDs and drop them if such vertices exist.
func DropVertexLabel ¶
DropVertexLabel will search for a vertex with the provided label and drop it if such a vertex exists.
func DropVerticesByQuery ¶
DropVerticesByQuery will consume the given query and drop the corresponding vertices.
func ExecuteQuery ¶
ExecuteQuery is used to execute a query to a gremlin server without having a client already created. For example you can use this if you are making quick small changes across multiple packages.
func ExecuteStringQuery ¶
ExecuteStringQuery is used to execute a query via a string to a gremlin server without have a client already created. For example this can be used if you are altering a graph through various packages.
func SetLogger ¶
SetLogger will replace the function used to log the queries being executed in the quick package.
func SetVertexProperty ¶
SetVertexProperty will search the graph for a vertex with the given ID and set the properties provided.
func Traversal ¶
Traversal is the main graph traversing object. This has every step you will need in a shorter format.
func VerboseTraversal ¶
VerboseTraversal is used for when you need to access the schema or verbose functions when adding vertices.
func VertexByID ¶
VertexByID will get a Vertex with the following ID assigned to it. This ID is unique to every vertex on the graph. This is the best way of finding vertices without any conflicting labels or properties.
func VertexCount ¶
VertexCount retrieves the number of vertices that are currently on the graph as an int64.
func VertexIDs ¶
VertexIDs takes the label and optional properties to retrieve the IDs desired from the graph.
func VertexIDsByQuery ¶
VertexIDsByQuery will take a query and execute it. Then it will run through and extract all the vertex IDs matching the traversal and return them in an array.
Types ¶
This section is empty.