hasbolt-0.1.4.4: Haskell driver for Neo4j 3+ (BOLT protocol)
Safe HaskellNone
LanguageHaskell2010

Database.Bolt

Synopsis

Documentation

data BoltActionT m a Source #

Monad Transformer to do all BOLT actions in

Instances

Instances details
MonadTrans BoltActionT Source # 
Instance details

Defined in Database.Bolt.Connection.Type

Methods

lift :: Monad m => m a -> BoltActionT m a #

Monad m => MonadReader Pipe (BoltActionT m) Source # 
Instance details

Defined in Database.Bolt.Connection.Type

Methods

ask :: BoltActionT m Pipe #

local :: (Pipe -> Pipe) -> BoltActionT m a -> BoltActionT m a #

reader :: (Pipe -> a) -> BoltActionT m a #

Monad m => MonadError BoltError (BoltActionT m) Source # 
Instance details

Defined in Database.Bolt.Connection.Type

Monad m => Monad (BoltActionT m) Source # 
Instance details

Defined in Database.Bolt.Connection.Type

Methods

(>>=) :: BoltActionT m a -> (a -> BoltActionT m b) -> BoltActionT m b #

(>>) :: BoltActionT m a -> BoltActionT m b -> BoltActionT m b #

return :: a -> BoltActionT m a #

Functor m => Functor (BoltActionT m) Source # 
Instance details

Defined in Database.Bolt.Connection.Type

Methods

fmap :: (a -> b) -> BoltActionT m a -> BoltActionT m b #

(<$) :: a -> BoltActionT m b -> BoltActionT m a #

Monad m => Applicative (BoltActionT m) Source # 
Instance details

Defined in Database.Bolt.Connection.Type

Methods

pure :: a -> BoltActionT m a #

(<*>) :: BoltActionT m (a -> b) -> BoltActionT m a -> BoltActionT m b #

liftA2 :: (a -> b -> c) -> BoltActionT m a -> BoltActionT m b -> BoltActionT m c #

(*>) :: BoltActionT m a -> BoltActionT m b -> BoltActionT m b #

(<*) :: BoltActionT m a -> BoltActionT m b -> BoltActionT m a #

MonadIO m => MonadIO (BoltActionT m) Source # 
Instance details

Defined in Database.Bolt.Connection.Type

Methods

liftIO :: IO a -> BoltActionT m a #

connect :: MonadIO m => HasCallStack => BoltCfg -> m Pipe Source #

Creates new Pipe instance to use all requests through

close :: MonadIO m => HasCallStack => Pipe -> m () Source #

Closes Pipe

reset :: MonadIO m => HasCallStack => Pipe -> m () Source #

Resets current sessions

run :: MonadIO m => HasCallStack => Pipe -> BoltActionT m a -> m a Source #

Runs BOLT action on selected pipe (with errors throw)

runE :: MonadIO m => HasCallStack => Pipe -> BoltActionT m a -> m (Either BoltError a) Source #

Runs BOLT action on selected pipe

queryP :: MonadIO m => Text -> Map Text Value -> BoltActionT m [Record] Source #

Runs Cypher query with parameters and returns list of obtained Records. Strict version

query :: MonadIO m => Text -> BoltActionT m [Record] Source #

Runs Cypher query and returns list of obtained Records. Strict version

queryP_ :: MonadIO m => HasCallStack => Text -> Map Text Value -> BoltActionT m () Source #

Runs Cypher query with parameters and ignores response

query_ :: MonadIO m => HasCallStack => Text -> BoltActionT m () Source #

Runs Cypher query and ignores response

transact :: MonadIO m => BoltActionT m a -> BoltActionT m a Source #

Runs a sequence of actions as transaction. All queries would be rolled back in case of any exception inside the block.

(=:) :: IsValue a => Text -> a -> (Text, Value) Source #

Wrap key-value pair with Value datatype

props :: [(Text, Value)] -> Map Text Value Source #

Construct properties map from list

data Pipe Source #

Instances

Instances details
Monad m => MonadReader Pipe (BoltActionT m) Source # 
Instance details

Defined in Database.Bolt.Connection.Type

Methods

ask :: BoltActionT m Pipe #

local :: (Pipe -> Pipe) -> BoltActionT m a -> BoltActionT m a #

reader :: (Pipe -> a) -> BoltActionT m a #

data BoltCfg Source #

Configuration of driver connection

Constructors

BoltCfg 

Fields

Instances

Instances details
Eq BoltCfg Source # 
Instance details

Defined in Database.Bolt.Connection.Type

Methods

(==) :: BoltCfg -> BoltCfg -> Bool #

(/=) :: BoltCfg -> BoltCfg -> Bool #

Read BoltCfg Source # 
Instance details

Defined in Database.Bolt.Connection.Type

Show BoltCfg Source # 
Instance details

Defined in Database.Bolt.Connection.Type

Default BoltCfg Source # 
Instance details

Defined in Database.Bolt.Connection.Type

Methods

def :: BoltCfg #

data Value Source #

The Value datatype generalizes all primitive BoltValues

Constructors

N () 
B Bool 
I Int 
F Double 
T Text 
L [Value] 
M (Map Text Value) 
S Structure 

Instances

Instances details
Eq Value Source # 
Instance details

Defined in Database.Bolt.Value.Type

Methods

(==) :: Value -> Value -> Bool #

(/=) :: Value -> Value -> Bool #

Show Value Source # 
Instance details

Defined in Database.Bolt.Value.Type

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

BoltValue Value Source # 
Instance details

Defined in Database.Bolt.Value.Instances

Methods

pack :: Value -> ByteString Source #

unpackT :: forall (m :: Type -> Type). Monad m => UnpackT m Value Source #

RecordValue Value Source # 
Instance details

Defined in Database.Bolt.Record

IsValue (Map Text Value) Source # 
Instance details

Defined in Database.Bolt.Value.Type

RecordValue (Map Text Value) Source # 
Instance details

Defined in Database.Bolt.Record

class IsValue a where Source #

Every datatype that can be represented as BOLT protocol value

Minimal complete definition

toValue

Methods

toValue :: a -> Value Source #

Wraps value with Value constructor

toValueList :: [a] -> Value Source #

How to represent a list of values

Instances

Instances details
IsValue Bool Source # 
Instance details

Defined in Database.Bolt.Value.Type

IsValue Char Source # 
Instance details

Defined in Database.Bolt.Value.Type

IsValue Double Source # 
Instance details

Defined in Database.Bolt.Value.Type

IsValue Float Source # 
Instance details

Defined in Database.Bolt.Value.Type

IsValue Int Source # 
Instance details

Defined in Database.Bolt.Value.Type

IsValue Integer Source # 
Instance details

Defined in Database.Bolt.Value.Type

IsValue () Source # 
Instance details

Defined in Database.Bolt.Value.Type

Methods

toValue :: () -> Value Source #

toValueList :: [()] -> Value Source #

IsValue Text Source # 
Instance details

Defined in Database.Bolt.Value.Type

IsValue a => IsValue [a] Source # 
Instance details

Defined in Database.Bolt.Value.Type

Methods

toValue :: [a] -> Value Source #

toValueList :: [[a]] -> Value Source #

IsValue (Map Text Value) Source # 
Instance details

Defined in Database.Bolt.Value.Type

data Structure Source #

The Structure datatype describes Neo4j structure for BOLT protocol

Constructors

Structure 

Fields

Instances

Instances details
Eq Structure Source # 
Instance details

Defined in Database.Bolt.Value.Type

Show Structure Source # 
Instance details

Defined in Database.Bolt.Value.Type

BoltValue Structure Source # 
Instance details

Defined in Database.Bolt.Value.Instances

Methods

pack :: Structure -> ByteString Source #

unpackT :: forall (m :: Type -> Type). Monad m => UnpackT m Structure Source #

type Record = Map Text Value Source #

Result type for query requests

class RecordValue a where Source #

Get exact type from Value

Instances

Instances details
RecordValue Bool Source # 
Instance details

Defined in Database.Bolt.Record

RecordValue Double Source # 
Instance details

Defined in Database.Bolt.Record

RecordValue Int Source # 
Instance details

Defined in Database.Bolt.Record

RecordValue () Source # 
Instance details

Defined in Database.Bolt.Record

RecordValue Text Source # 
Instance details

Defined in Database.Bolt.Record

RecordValue Path Source # 
Instance details

Defined in Database.Bolt.Record

RecordValue URelationship Source # 
Instance details

Defined in Database.Bolt.Record

RecordValue Relationship Source # 
Instance details

Defined in Database.Bolt.Record

RecordValue Node Source # 
Instance details

Defined in Database.Bolt.Record

RecordValue Value Source # 
Instance details

Defined in Database.Bolt.Record

RecordValue a => RecordValue [a] Source # 
Instance details

Defined in Database.Bolt.Record

RecordValue a => RecordValue (Maybe a) Source # 
Instance details

Defined in Database.Bolt.Record

RecordValue (Map Text Value) Source # 
Instance details

Defined in Database.Bolt.Record

at :: (Monad m, RecordValue a) => Record -> Text -> BoltActionT m a Source #

Gets result from obtained record

data Node Source #

Constructors

Node 

Fields

Instances

Instances details
Eq Node Source # 
Instance details

Defined in Database.Bolt.Value.Type

Methods

(==) :: Node -> Node -> Bool #

(/=) :: Node -> Node -> Bool #

Show Node Source # 
Instance details

Defined in Database.Bolt.Value.Type

Methods

showsPrec :: Int -> Node -> ShowS #

show :: Node -> String #

showList :: [Node] -> ShowS #

FromStructure Node Source # 
Instance details

Defined in Database.Bolt.Value.Instances

RecordValue Node Source # 
Instance details

Defined in Database.Bolt.Record

data Relationship Source #

Constructors

Relationship 

Fields

data URelationship Source #

Constructors

URelationship 

Fields

data Path Source #

Constructors

Path 

Fields

Instances

Instances details
Eq Path Source # 
Instance details

Defined in Database.Bolt.Value.Type

Methods

(==) :: Path -> Path -> Bool #

(/=) :: Path -> Path -> Bool #

Show Path Source # 
Instance details

Defined in Database.Bolt.Value.Type

Methods

showsPrec :: Int -> Path -> ShowS #

show :: Path -> String #

showList :: [Path] -> ShowS #

FromStructure Path Source # 
Instance details

Defined in Database.Bolt.Value.Instances

RecordValue Path Source # 
Instance details

Defined in Database.Bolt.Record