gargantext-0.0.4.9.5: Search, map, share
Safe HaskellNone
LanguageHaskell2010

Gargantext.Database.Query.Table.Node

Description

import Gargantext.Database.Prelude (Cmd, runPGSQuery) Module : Gargantext.Database.Query.Table.Node Description : Main Tools of Node to the database Copyright : (c) CNRS, 2017-Present License : AGPL + CECILL v3 Maintainer : team@gargantext.org Stability : experimental Portability : POSIX

Synopsis

Documentation

selectNodesWith :: HasDBid NodeType => ParentId -> Maybe NodeType -> Maybe Offset -> Maybe Limit -> Query NodeRead Source #

order by publication date Favorites (Bool), node_ngrams

getClosestParentIdByType :: HasDBid NodeType => NodeId -> NodeType -> Cmd err (Maybe NodeId) Source #

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 -> Cmd err (Maybe NodeId) Source #

Similar to getClosestParentIdByType but includes current node in search too

getChildrenByType :: HasDBid NodeType => NodeId -> NodeType -> Cmd err [NodeId] Source #

Given a node id, find all it's children (no matter how deep) of given node type.

getNodesWithType :: (HasNodeError err, JSONB a, HasDBid NodeType) => NodeType -> proxy a -> Cmd err [Node a] Source #

Example of use: runCmdReplEasy (getNodesWithType NodeList (Proxy :: Proxy HyperdataList))

getNodesIdWithType :: (HasNodeError err, HasDBid NodeType) => NodeType -> Cmd err [NodeId] Source #

getNode :: HasNodeError err => NodeId -> Cmd err (Node Value) Source #

getNodeWith :: (HasNodeError err, JSONB a) => NodeId -> proxy a -> Cmd err (Node a) Source #

insertDefaultNode :: HasDBid NodeType => NodeType -> ParentId -> UserId -> Cmd err [NodeId] Source #

Sugar to insert Node with NodeType in Database

insertNode :: HasDBid NodeType => NodeType -> Maybe Name -> Maybe DefaultHyperdata -> ParentId -> UserId -> Cmd err [NodeId] Source #

nodeW :: HasDBid NodeType => NodeType -> Maybe Name -> Maybe DefaultHyperdata -> ParentId -> UserId -> NodeWrite Source #

node :: (ToJSON a, Hyperdata a, HasDBid NodeType) => NodeType -> Name -> a -> Maybe ParentId -> UserId -> NodeWrite Source #

insertNodes :: [NodeWrite] -> Cmd err Int64 Source #

insertNodesR :: [NodeWrite] -> Cmd err [NodeId] Source #

data Node' Source #

Constructors

Node' 

Instances

Instances details
Show Node' Source # 
Instance details

Defined in Gargantext.Database.Query.Table.Node

Methods

showsPrec :: Int -> Node' -> ShowS #

show :: Node' -> String #

showList :: [Node'] -> ShowS #

mkNodes :: [NodeWrite] -> Cmd err Int64 Source #

mkNodeR :: [NodeWrite] -> Cmd err [NodeId] Source #

data CorpusType Source #

CorpusDocument is a corpus made from a set of documents CorpusContact is a corpus made from a set of contacts (syn of Annuaire)

getOrMkList :: (HasNodeError err, HasDBid NodeType) => ParentId -> UserId -> Cmd err ListId Source #

defaultList :: (HasNodeError err, HasDBid NodeType) => CorpusId -> Cmd err ListId Source #

TODO remove defaultList

defaultListMaybe :: (HasNodeError err, HasDBid NodeType) => CorpusId -> Cmd err (Maybe NodeId) Source #