haskell-neo4j-client-0.3.0.0: A Haskell neo4j client

Safe HaskellNone

Database.Neo4j.Transactional.Cypher

Contents

Synopsis

Types

data Result Source

Type for a Cypher response with tuples containing column name and their values

Constructors

Result 

Fields

cols :: [Text]
 
vals :: [[Value]]
 
graph :: [Graph]
 
stats :: Stats
 

Instances

Eq Result 
Show Result 
FromJSON Result

How to create a response object from a cypher JSON response

data Stats Source

Holds the connection stats

Constructors

Stats 

Fields

containsUpdates :: Bool
 
nodesCreated :: Integer
 
nodesDeleted :: Integer
 
propsSet :: Integer
 
relsCreated :: Integer
 
relsDeleted :: Integer
 
lblsAdded :: Integer
 
lblsRemoved :: Integer
 
idxAdded :: Integer
 
idxRemoved :: Integer
 
constAdded :: Integer
 
constRemoved :: Integer
 

Instances

Eq Stats 
Show Stats 
FromJSON Stats

Instance to parse stats from a JSON

data ParamValue Source

Value for a cypher parmeter value, might be a literal, a property map or a list of property maps

Instances

Eq ParamValue 
Show ParamValue 
ToJSON ParamValue

Instance toJSON for param values so we can serialize them in queries

type Params = HashMap Text ParamValueSource

We use hashmaps to represent Cypher parameters

newparam :: PropertyValueConstructor a => a -> ParamValueSource

emptyStats :: StatsSource

Default stats

Sending queries

loneQuery :: Text -> Params -> Neo4j (Either TransError Result)Source

isSuccess :: Either TransError Result -> BoolSource

True if the operation succeeded

fromResult :: Result -> Either TransError Result -> ResultSource

Get the result of the response or a default value

fromSuccess :: Either TransError Result -> ResultSource

Get the result of the response or a default value

runTransaction :: Transaction a -> Neo4j (Either TransError a)Source

Run a transaction and get its final result, has an implicit commit request (or rollback if an exception occurred) | This implicit commit/rollback will only be executed if it hasn't before because of an explicit one

cypher :: Text -> Params -> Transaction ResultSource

Run a cypher query in a transaction, if an error occurs the transaction will stop and rollback

rollback :: Transaction ()Source

Rollback a transaction after this, executing rollback, commit, keepalive, cypher in the transaction will result in an exception

commit :: Transaction ()Source

Commit a transaction after this, executing rollback, commit, keepalive, cypher in the transaction will result in an exception

keepalive :: Transaction ()Source

Send a keep alive message to an open transaction

commitWith :: Text -> Params -> Transaction ResultSource

Send a cypher query and commit at the same time, if an error occurs the transaction will be rolled back after this, executing rollback, commit, keepalive, cypher in the transaction will result in an exception