Safe Haskell | None |
---|---|
Language | Haskell98 |
Database.Neo4j.Types
- newtype Neo4jVersion = Neo4jVersion {}
- (<>) :: Monoid a => a -> a -> a
- data Val
- data PropertyValue
- = ValueProperty Val
- | ArrayProperty [Val]
- class PropertyValueConstructor a where
- (|:) :: PropertyValueConstructor a => Text -> a -> (Text, PropertyValue)
- type Properties = HashMap Text PropertyValue
- emptyProperties :: HashMap Text PropertyValue
- urlPath :: Text -> Text
- urlMinPath :: Text -> Text
- data EntityObj
- class Entity a where
- newtype NodeUrl = NodeUrl {
- runNodeUrl :: Text
- data Node = Node {}
- getNodeProperties :: Node -> Properties
- nodeAPI :: ByteString
- nodeAPITxt :: Text
- newtype NodePath = NodePath {
- runNodePath :: Text
- class NodeIdentifier a where
- runNodeIdentifier :: NodeIdentifier a => a -> ByteString
- type RelationshipType = Text
- data Direction
- newtype RelUrl = RelUrl {}
- data Relationship = Relationship {}
- getRelProperties :: Relationship -> Properties
- getRelType :: Relationship -> RelationshipType
- relationshipAPI :: ByteString
- relationshipAPITxt :: Text
- newtype RelPath = RelPath {
- runRelPath :: Text
- class RelIdentifier a where
- runRelIdentifier :: RelIdentifier a => a -> ByteString
- data EntityPath
- class EntityIdentifier a where
- type Label = Text
- data Index = Index {
- indexLabel :: Label
- indexProperties :: [Text]
- data Neo4jException
- data Connection = Connection {
- dbHostname :: Hostname
- dbPort :: Port
- manager :: Manager
- dbCredentials :: Maybe Credentials
- dbSecure :: Bool
- type Hostname = ByteString
- type Port = Int
- type Credentials = (Username, Password)
- type Username = ByteString
- type Password = ByteString
- getUsername :: Credentials -> ByteString
- getPassword :: Credentials -> ByteString
- newtype Neo4j a = Neo4j {
- runNeo4j :: Connection -> IO a
Documentation
Type for a single value of a Neo4j property
data PropertyValue Source #
Wrapping type for a Neo4j single property or array of properties Using these types allows type checking for only correct properties that is int, double, string, boolean and single typed arrays of these, also nulls are not allowed
Constructors
ValueProperty Val | |
ArrayProperty [Val] |
Instances
Eq PropertyValue Source # | |
Show PropertyValue Source # | |
FromJSON PropertyValue Source # | JSON to property values |
ToJSON PropertyValue Source # | Specifying how to convert property values to JSON |
class PropertyValueConstructor a where Source #
This class allows easy construction of property value types from literals
Minimal complete definition
Methods
newval :: a -> PropertyValue Source #
Instances
(|:) :: PropertyValueConstructor a => Text -> a -> (Text, PropertyValue) Source #
This operator allows easy construction of property value types from literals
type Properties = HashMap Text PropertyValue Source #
We use hashmaps to represent Neo4j properties
emptyProperties :: HashMap Text PropertyValue Source #
Shortcut for emtpy properties
urlPath :: Text -> Text Source #
Tries to get the path from a URL, we try our best otherwise return the url as is
urlMinPath :: Text -> Text Source #
Path without the dbdata part, useful for batch paths and such
Constructors
EntityNode Node | |
EntityRel Relationship |
Class for top-level Neo4j entities (nodes and relationships) useful to have generic property management code
Minimal complete definition
entityPath, propertyPath, getEntityProperties, setEntityProperties, entityObj
Methods
entityPath :: a -> ByteString Source #
propertyPath :: a -> ByteString Source #
getEntityProperties :: a -> Properties Source #
setEntityProperties :: a -> Properties -> a Source #
Constructors
NodeUrl | |
Fields
|
Representation of a Neo4j node, has a location URI and a set of properties
Constructors
Node | |
Fields |
Instances
Eq Node Source # | |
Ord Node Source # | |
Show Node Source # | |
FromJSON Node Source # | JSON to Node |
FromJSON FullPath # | How to decodify an IdPath from JSON |
EntityIdentifier Node Source # | |
NodeIdentifier Node Source # | |
Entity Node Source # | |
NodeBatchIdentifier Node Source # | |
BatchEntity Node Source # | |
NodeBatchIdentifier (BatchFuture Node) Source # | |
BatchEntity (BatchFuture Node) Source # | |
getNodeProperties :: Node -> Properties Source #
Get the properties of a node
nodeAPI :: ByteString Source #
nodeAPITxt :: Text Source #
Constructors
NodePath | |
Fields
|
Instances
Eq NodePath Source # | |
Ord NodePath Source # | |
Show NodePath Source # | |
Generic NodePath Source # | |
Hashable NodePath Source # | |
FromJSON IdPath # | How to decodify an IdPath from JSON |
EntityIdentifier NodePath Source # | |
NodeIdentifier NodePath Source # | |
NodeBatchIdentifier NodePath Source # | |
BatchEntity NodePath Source # | |
type Rep NodePath Source # | |
class NodeIdentifier a where Source #
Minimal complete definition
Methods
getNodePath :: a -> NodePath Source #
runNodeIdentifier :: NodeIdentifier a => a -> ByteString Source #
type RelationshipType = Text Source #
Type for a relationship type description
Relationship direction
Type for a relationship location
data Relationship Source #
Type for a Neo4j relationship, has a location URI, a relationship type, a starting node and a destination node
Constructors
Relationship | |
Fields
|
Instances
Eq Relationship Source # | |
Ord Relationship Source # | |
Show Relationship Source # | |
FromJSON Relationship Source # | JSON to Relationship |
FromJSON FullPath # | How to decodify an IdPath from JSON |
EntityIdentifier Relationship Source # | |
RelIdentifier Relationship Source # | |
Entity Relationship Source # | |
RelBatchIdentifier Relationship Source # | |
BatchEntity Relationship Source # | |
RelBatchIdentifier (BatchFuture Relationship) Source # | |
BatchEntity (BatchFuture Relationship) Source # | |
getRelProperties :: Relationship -> Properties Source #
Get the properties of a relationship
getRelType :: Relationship -> RelationshipType Source #
Get the type of a relationship
Constructors
RelPath | |
Fields
|
Instances
Eq RelPath Source # | |
Ord RelPath Source # | |
Show RelPath Source # | |
Generic RelPath Source # | |
Hashable RelPath Source # | |
FromJSON IdPath # | How to decodify an IdPath from JSON |
EntityIdentifier RelPath Source # | |
RelIdentifier RelPath Source # | |
RelBatchIdentifier RelPath Source # | |
BatchEntity RelPath Source # | |
type Rep RelPath Source # | |
class RelIdentifier a where Source #
Minimal complete definition
Methods
getRelPath :: a -> RelPath Source #
runRelIdentifier :: RelIdentifier a => a -> ByteString Source #
class EntityIdentifier a where Source #
Minimal complete definition
Methods
getEntityPath :: a -> EntityPath Source #
Type for an index
Constructors
Index | |
Fields
|
data Neo4jException Source #
Exceptions this library can raise
Constructors
Instances
data Connection Source #
Type for a connection
Constructors
Connection | |
Fields
|
type Hostname = ByteString Source #
type Credentials = (Username, Password) Source #
type Username = ByteString Source #
type Password = ByteString Source #
getUsername :: Credentials -> ByteString Source #
getPassword :: Credentials -> ByteString Source #
Neo4j monadic type to be able to sequence neo4j commands in a connection
Constructors
Neo4j | |
Fields
|