hasbolt-extras-0.0.0.2: Extras for hasbolt library

Safe HaskellNone
LanguageHaskell2010

Database.Bolt.Extras.Query

Synopsis

Documentation

type GraphGetRequest = Graph NodeName NodeGetter RelGetter Source #

The combinations of Getters to load graph from the database.

data NodeGetter Source #

Helper to find Nodes. _varQNName is the mark for this Node, which will be used in Cypher queries. For example "MATCH(a)", here _varQNName = "a"

Constructors

NodeGetter 

data PutNode Source #

For given Node _ labels nodeProps makes query MERGE (n:labels {props}) RETURN ID(n) as n and then return Node with actual ID.

Potentially, if you MERGE some Node and it labels and props are occured in several Nodes, then the result can be not one but several Nodes.

Constructors

BoltId BoltId 
Merge Node 
Create Node 

Instances

data RelGetter Source #

RelGetter is used for searching using indexes of Nodes in the given graph.

Constructors

RelGetter 

class ToCypher a where Source #

The class for convertation into Cypher.

Minimal complete definition

toCypher

Methods

toCypher :: a -> Text Source #

Instances

ToCypher Value Source #

Convertation for Value into Cypher.

Methods

toCypher :: Value -> Text Source #

ToCypher Property Source #

Converts property with name and value to name:value.

ToCypher Label Source #

Label with name are formatted into :name

Methods

toCypher :: Label -> Text Source #

ToCypher [Property] Source #

Several properties are formatted with concatenation.

Methods

toCypher :: [Property] -> Text Source #

ToCypher [Label] Source #

Several labels are formatted with concatenation.

Methods

toCypher :: [Label] -> Text Source #

getGraph :: MonadIO m => [Text] -> GraphGetRequest -> BoltActionT m [GraphGetResponse] Source #

For the given GraphGetRequest find the graph, which matches it. This function creates single cypher query and performs it.

putGraph :: MonadIO m => GraphPutRequest -> BoltActionT m GraphPutResponse Source #

Create Graph using given GraphU and the list describing Nodes indices (from the given _vertices), which should be connected by the corresponding Relationship. If there were multiple choices while merging given _vertices, the first match is used for connection.