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 #
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 # | |
Show PropertyValue # | |
ToJSON PropertyValue # | Specifying how to convert property values to JSON |
FromJSON PropertyValue # | JSON to property values |
class PropertyValueConstructor a where #
This class allows easy construction of property value types from literals
Minimal complete definition
Methods
newval :: a -> PropertyValue #
(|:) :: PropertyValueConstructor a => Text -> a -> (Text, PropertyValue) #
This operator allows easy construction of property value types from literals
type Properties = HashMap Text PropertyValue #
We use hashmaps to represent Neo4j properties
emptyProperties :: HashMap Text PropertyValue #
Shortcut for emtpy properties
Tries to get the path from a URL, we try our best otherwise return the url as is
urlMinPath :: Text -> Text #
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 #
propertyPath :: a -> ByteString #
getEntityProperties :: a -> Properties #
setEntityProperties :: a -> Properties -> a #
Constructors
NodeUrl | |
Fields
|
Representation of a Neo4j node, has a location URI and a set of properties
Constructors
Node | |
Fields |
Instances
Eq Node # | |
Ord Node # | |
Show Node # | |
FromJSON Node # | JSON to Node |
FromJSON FullPath # | How to decodify an IdPath from JSON |
EntityIdentifier Node # | |
NodeIdentifier Node # | |
Entity Node # | |
NodeBatchIdentifier Node # | |
BatchEntity Node # | |
NodeBatchIdentifier (BatchFuture Node) # | |
BatchEntity (BatchFuture Node) # | |
getNodeProperties :: Node -> Properties #
Get the properties of a node
nodeAPI :: ByteString #
nodeAPITxt :: Text #
Constructors
NodePath | |
Fields
|
runNodeIdentifier :: NodeIdentifier a => a -> ByteString #
type RelationshipType = Text #
Type for a relationship type description
Relationship direction
Type for a relationship location
data Relationship #
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 # | |
Ord Relationship # | |
Show Relationship # | |
FromJSON Relationship # | JSON to Relationship |
FromJSON FullPath # | How to decodify an IdPath from JSON |
EntityIdentifier Relationship # | |
RelIdentifier Relationship # | |
Entity Relationship # | |
RelBatchIdentifier Relationship # | |
BatchEntity Relationship # | |
RelBatchIdentifier (BatchFuture Relationship) # | |
BatchEntity (BatchFuture Relationship) # | |
getRelProperties :: Relationship -> Properties #
Get the properties of a relationship
getRelType :: Relationship -> RelationshipType #
Get the type of a relationship
Constructors
RelPath | |
Fields
|
runRelIdentifier :: RelIdentifier a => a -> ByteString #
class EntityIdentifier a where #
Minimal complete definition
Methods
getEntityPath :: a -> EntityPath #
Type for an index
Constructors
Index | |
Fields
|
data Neo4jException #
Exceptions this library can raise
Constructors
Instances
data Connection #
Type for a connection
Constructors
Connection | |
Fields
|
type Hostname = ByteString #
type Credentials = (Username, Password) #
type Username = ByteString #
type Password = ByteString #
getUsername :: Credentials -> ByteString #
getPassword :: Credentials -> ByteString #