Copyright | (c) CNRS 2017-Present |
---|---|
License | AGPL + CECILL v3 |
Maintainer | team@gargantext.org |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- queryNodeSearchTable :: Select NodeSearchRead
- selectNode :: Column SqlInt4 -> Select NodeRead
- runGetNodes :: Select NodeRead -> DBCmd err [Node HyperdataAny]
- selectNodesWith :: HasDBid NodeType => ParentId -> Maybe NodeType -> Maybe Offset -> Maybe Limit -> Select NodeRead
- selectNodesWith' :: HasDBid NodeType => ParentId -> Maybe NodeType -> Select NodeRead
- deleteNode :: NodeId -> DBCmd err Int
- deleteNodes :: [NodeId] -> DBCmd err Int
- getNodesWith :: (JSONB a, HasDBid NodeType) => NodeId -> proxy a -> Maybe NodeType -> Maybe Offset -> Maybe Limit -> DBCmd err [Node a]
- getNodesWithParentId :: (Hyperdata a, JSONB a) => Maybe NodeId -> DBCmd err [Node a]
- getClosestParentIdByType :: HasDBid NodeType => NodeId -> NodeType -> DBCmd err (Maybe NodeId)
- getClosestParentIdByType' :: HasDBid NodeType => NodeId -> NodeType -> DBCmd err (Maybe NodeId)
- getChildrenByType :: HasDBid NodeType => NodeId -> NodeType -> DBCmd err [NodeId]
- getClosestChildrenByType :: HasDBid NodeType => NodeId -> NodeType -> DBCmd err [NodeId]
- getDocumentsV3WithParentId :: HasDBid NodeType => NodeId -> DBCmd err [Node HyperdataDocumentV3]
- getDocumentsWithParentId :: HasDBid NodeType => NodeId -> DBCmd err [Node HyperdataDocument]
- getListsModelWithParentId :: HasDBid NodeType => NodeId -> DBCmd err [Node HyperdataModel]
- getCorporaWithParentId :: HasDBid NodeType => NodeId -> DBCmd err [Node HyperdataCorpus]
- selectNodesWithParentID :: NodeId -> Select NodeRead
- getNodesWithType :: (HasNodeError err, JSONB a, HasDBid NodeType) => NodeType -> proxy a -> DBCmd err [Node a]
- getNodeWithType :: (HasNodeError err, JSONB a, HasDBid NodeType) => NodeId -> NodeType -> proxy a -> DBCmd err [Node a]
- getNodesIdWithType :: (HasNodeError err, HasDBid NodeType) => NodeType -> DBCmd err [NodeId]
- selectNodesIdWithType :: HasDBid NodeType => NodeType -> Select (Column SqlInt4)
- nodeExists :: HasNodeError err => NodeId -> DBCmd err Bool
- getNode :: HasNodeError err => NodeId -> DBCmd err (Node Value)
- getNodeWith :: (HasNodeError err, JSONB a) => NodeId -> proxy a -> DBCmd err (Node a)
- insertDefaultNode :: (HasDBid NodeType, HasNodeError err) => NodeType -> ParentId -> UserId -> DBCmd err NodeId
- insertDefaultNodeIfNotExists :: (HasDBid NodeType, HasNodeError err) => NodeType -> ParentId -> UserId -> DBCmd err [NodeId]
- insertNode :: (HasDBid NodeType, HasNodeError err) => NodeType -> Maybe Name -> Maybe DefaultHyperdata -> ParentId -> UserId -> DBCmd err NodeId
- nodeW :: HasDBid NodeType => NodeType -> Maybe Name -> Maybe DefaultHyperdata -> ParentId -> UserId -> NodeWrite
- node :: (ToJSON a, Hyperdata a, HasDBid NodeType) => NodeType -> Name -> a -> Maybe ParentId -> UserId -> NodeWrite
- insertNodes :: [NodeWrite] -> DBCmd err Int64
- insertNodesR :: [NodeWrite] -> DBCmd err [NodeId]
- insertNodesWithParent :: Maybe ParentId -> [NodeWrite] -> DBCmd err Int64
- insertNodesWithParentR :: Maybe ParentId -> [NodeWrite] -> DBCmd err [NodeId]
- node2table :: HasDBid NodeType => UserId -> Maybe ParentId -> Node' -> NodeWrite
- data Node' = Node' {}
- mkNodes :: [NodeWrite] -> DBCmd err Int64
- mkNodeR :: [NodeWrite] -> DBCmd err [NodeId]
- childWith :: HasDBid NodeType => UserId -> ParentId -> Node' -> NodeWrite
- data CorpusType
- class MkCorpus a where
- getOrMkList :: (HasNodeError err, HasDBid NodeType) => ParentId -> UserId -> DBCmd err ListId
- defaultList :: (HasNodeError err, HasDBid NodeType) => CorpusId -> DBCmd err ListId
- defaultListMaybe :: (HasNodeError err, HasDBid NodeType) => CorpusId -> DBCmd err (Maybe NodeId)
- getListsWithParentId :: HasDBid NodeType => NodeId -> DBCmd err [Node HyperdataList]
Documentation
runGetNodes :: Select NodeRead -> DBCmd err [Node HyperdataAny] #
selectNodesWith :: HasDBid NodeType => ParentId -> Maybe NodeType -> Maybe Offset -> Maybe Limit -> Select NodeRead #
order by publication date Favorites (Bool), node_ngrams
deleteNode :: NodeId -> DBCmd err Int #
deleteNodes :: [NodeId] -> DBCmd err Int #
getNodesWith :: (JSONB a, HasDBid NodeType) => NodeId -> proxy a -> Maybe NodeType -> Maybe Offset -> Maybe Limit -> DBCmd err [Node a] #
getClosestParentIdByType :: HasDBid NodeType => NodeId -> NodeType -> DBCmd err (Maybe NodeId) #
Given a node id, find it's closest parent of given type NOTE: This isn't too optimal: can make successive queries depending on how deeply nested the child is.
getClosestParentIdByType' :: HasDBid NodeType => NodeId -> NodeType -> DBCmd err (Maybe NodeId) #
Similar to getClosestParentIdByType
but includes current node
in search too
getChildrenByType :: HasDBid NodeType => NodeId -> NodeType -> DBCmd err [NodeId] #
Given a node id, find all it's children (no matter how deep) of given node type.
getClosestChildrenByType :: HasDBid NodeType => NodeId -> NodeType -> DBCmd err [NodeId] #
Given a node id, find all it's children (only first level) of given node type.
getDocumentsV3WithParentId :: HasDBid NodeType => NodeId -> DBCmd err [Node HyperdataDocumentV3] #
getDocumentsWithParentId :: HasDBid NodeType => NodeId -> DBCmd err [Node HyperdataDocument] #
getListsModelWithParentId :: HasDBid NodeType => NodeId -> DBCmd err [Node HyperdataModel] #
getCorporaWithParentId :: HasDBid NodeType => NodeId -> DBCmd err [Node HyperdataCorpus] #
getNodesWithType :: (HasNodeError err, JSONB a, HasDBid NodeType) => NodeType -> proxy a -> DBCmd err [Node a] #
Example of use: runCmdReplEasy (getNodesWithType NodeList (Proxy :: Proxy HyperdataList))
getNodeWithType :: (HasNodeError err, JSONB a, HasDBid NodeType) => NodeId -> NodeType -> proxy a -> DBCmd err [Node a] #
getNodesIdWithType :: (HasNodeError err, HasDBid NodeType) => NodeType -> DBCmd err [NodeId] #
nodeExists :: HasNodeError err => NodeId -> DBCmd err Bool #
getNodeWith :: (HasNodeError err, JSONB a) => NodeId -> proxy a -> DBCmd err (Node a) #
insertDefaultNode :: (HasDBid NodeType, HasNodeError err) => NodeType -> ParentId -> UserId -> DBCmd err NodeId #
Sugar to insert Node with NodeType in Database
insertDefaultNodeIfNotExists :: (HasDBid NodeType, HasNodeError err) => NodeType -> ParentId -> UserId -> DBCmd err [NodeId] #
insertNode :: (HasDBid NodeType, HasNodeError err) => NodeType -> Maybe Name -> Maybe DefaultHyperdata -> ParentId -> UserId -> DBCmd err NodeId #
nodeW :: HasDBid NodeType => NodeType -> Maybe Name -> Maybe DefaultHyperdata -> ParentId -> UserId -> NodeWrite #
node :: (ToJSON a, Hyperdata a, HasDBid NodeType) => NodeType -> Name -> a -> Maybe ParentId -> UserId -> NodeWrite #
insertNodes :: [NodeWrite] -> DBCmd err Int64 #
insertNodesR :: [NodeWrite] -> DBCmd err [NodeId] #
data CorpusType #
CorpusDocument is a corpus made from a set of documents CorpusContact is a corpus made from a set of contacts (syn of Annuaire)
mk :: (HasDBid NodeType, HasNodeError err) => Maybe Name -> Maybe a -> ParentId -> UserId -> DBCmd err [NodeId] #
Instances
getOrMkList :: (HasNodeError err, HasDBid NodeType) => ParentId -> UserId -> DBCmd err ListId #
defaultList :: (HasNodeError err, HasDBid NodeType) => CorpusId -> DBCmd err ListId #
TODO remove defaultList
defaultListMaybe :: (HasNodeError err, HasDBid NodeType) => CorpusId -> DBCmd err (Maybe NodeId) #
getListsWithParentId :: HasDBid NodeType => NodeId -> DBCmd err [Node HyperdataList] #