Commit 9caf5372 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[DB/FACTO] splitting Action into Action and Queries

parent daaca8b8
......@@ -72,7 +72,7 @@ import Gargantext.API.Ngrams (HasRepo(..), HasRepoSaver(..), saveRepo, TableNgra
import Gargantext.API.Node
import Gargantext.API.Search (SearchPairsAPI, searchPairs)
import Gargantext.Core.Types.Individu (User(..))
import Gargantext.Database.Action.Query.Node.Contact (HyperdataContact)
import Gargantext.Database.Query.Table.Node.Contact (HyperdataContact)
import Gargantext.Database.Admin.Types.Node
import Gargantext.Database.Admin.Types.Node (NodeId, CorpusId, AnnuaireId)
import Gargantext.Database.Admin.Utils (HasConnectionPool)
......
......@@ -44,8 +44,8 @@ import Gargantext.API.Admin.Settings
import Gargantext.API.Admin.Types (HasJoseError(..), joseError, HasServerError, GargServerC)
import Gargantext.Core.Types.Individu (User(..), Username, Password, arbitraryUsername, arbitraryPassword)
import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger)
import Gargantext.Database.Action.Query.Tree (isDescendantOf, isIn)
import Gargantext.Database.Action.Query.Tree.Root (getRoot)
import Gargantext.Database.Query.Tree (isDescendantOf, isIn)
import Gargantext.Database.Query.Tree.Root (getRoot)
import Gargantext.Database.Schema.Node (NodePoly(_node_id))
import Gargantext.Database.Admin.Types.Node (NodeId(..), UserId, ListId, DocId)
import Gargantext.Database.Admin.Utils (Cmd', CmdM, HasConnectionPool)
......
......@@ -9,7 +9,6 @@ Portability : POSIX
-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
......@@ -41,7 +40,7 @@ import Gargantext.API.Admin.Orchestrator.Types
import Gargantext.API.Admin.Settings
import Gargantext.API.Ngrams
import Gargantext.Core.Types
import Gargantext.Database.Action.Query.Tree
import Gargantext.Database.Query.Tree
import Gargantext.Database.Admin.Types.Errors (NodeError(..), HasNodeError(..))
import Gargantext.Database.Admin.Utils
import Gargantext.Prelude
......
......@@ -38,8 +38,8 @@ import Gargantext.API.Admin.Types (GargNoServer)
import Gargantext.Core.Types --
import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger)
import Gargantext.Database.Action.Metrics.NgramsByNode (getNgramsByNodeOnlyUser)
import Gargantext.Database.Action.Query.Node
import Gargantext.Database.Action.Query.Node.Select (selectNodesWithUsername)
import Gargantext.Database.Query.Table.Node
import Gargantext.Database.Query.Table.Node.Select (selectNodesWithUsername)
import Gargantext.Database.Admin.Config (userMaster)
import Gargantext.Database.Admin.Types.Errors (HasNodeError)
import Gargantext.Database.Admin.Types.Node (Node, HyperdataDocument(..), NodeId, ListId, CorpusId)
......
......@@ -127,7 +127,7 @@ import Gargantext.Core.Types (TODO)
import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger)
import Gargantext.Database.Action.Metrics.NgramsByNode (getOccByNgramsOnlyFast')
import Gargantext.Database.Query.Table.Ngrams
import Gargantext.Database.Action.Query.Node.Select
import Gargantext.Database.Query.Table.Node.Select
import Gargantext.Database.Admin.Config (userMaster)
import Gargantext.Database.Admin.Types.Errors (HasNodeError)
import Gargantext.Database.Admin.Types.Node (NodeType(..))
......
......@@ -54,13 +54,13 @@ import Gargantext.API.Table
import Gargantext.Core.Types (NodeTableResult)
import Gargantext.Core.Types.Main (Tree, NodeTree, ListType)
import Gargantext.Database.Action.Flow.Pairing (pairing)
import Gargantext.Database.Action.Query
import Gargantext.Database.Action.Query.Facet (FacetDoc, OrderBy(..))
import Gargantext.Database.Action.Query.Node hiding (postNode)
import Gargantext.Database.Action.Query.Node.Children (getChildren)
import Gargantext.Database.Action.Query.Node.UpdateOpaleye (updateHyperdata)
import Gargantext.Database.Action.Query.Node.User
import Gargantext.Database.Action.Query.Tree (treeDB)
import Gargantext.Database.Query
import Gargantext.Database.Query.Facet (FacetDoc, OrderBy(..))
import Gargantext.Database.Query.Table.Node hiding (postNode)
import Gargantext.Database.Query.Table.Node.Children (getChildren)
import Gargantext.Database.Query.Table.Node.UpdateOpaleye (updateHyperdata)
import Gargantext.Database.Query.Table.Node.User
import Gargantext.Database.Query.Tree (treeDB)
import Gargantext.Database.Admin.Config (nodeTypeId)
import Gargantext.Database.Admin.Types.Errors (HasNodeError(..))
import Gargantext.Database.Admin.Types.Node
......@@ -74,7 +74,7 @@ import Gargantext.Viz.Phylo.API (PhyloAPI, phyloAPI)
import Servant
import Test.QuickCheck (elements)
import Test.QuickCheck.Arbitrary (Arbitrary, arbitrary)
import qualified Gargantext.Database.Action.Query.Node.Update as U (update, Update(..))
import qualified Gargantext.Database.Query.Table.Node.Update as U (update, Update(..))
{-
import qualified Gargantext.Text.List.Learn as Learn
......
......@@ -32,7 +32,7 @@ import Data.Time (UTCTime)
import GHC.Generics (Generic)
import Gargantext.API.Admin.Types (GargServer)
import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger)
import Gargantext.Database.Action.Query.Facet
import Gargantext.Database.Query.Facet
import Gargantext.Database.Action.Search
import Gargantext.Database.Admin.Types.Node
import Gargantext.Prelude
......
......@@ -46,7 +46,7 @@ import GHC.Generics (Generic)
import Gargantext.API.Ngrams (TabType(..))
import Gargantext.Core.Types (Offset, Limit, TableResult(..))
import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger)
import Gargantext.Database.Action.Query.Facet (FacetDoc , runViewDocuments, OrderBy(..), runViewAuthorsDoc)
import Gargantext.Database.Query.Facet (FacetDoc , runViewDocuments, OrderBy(..), runViewAuthorsDoc)
import Gargantext.Database.Action.Learn (FavOrTrash(..), moreLike)
import Gargantext.Database.Action.Search
import Gargantext.Database.Admin.Types.Node
......
......@@ -22,7 +22,7 @@ import Data.Map (Map)
import Data.Maybe (Maybe)
import Gargantext.Text (HasText(..))
import Gargantext.Core.Types.Main (HashId)
import Gargantext.Database.Action.Query.Node.Contact -- (HyperdataContact(..))
import Gargantext.Database.Query.Table.Node.Contact -- (HyperdataContact(..))
import Gargantext.Database.Admin.Types.Node -- (HyperdataDocument(..))
import Gargantext.Database.Schema.Ngrams (Ngrams, NgramsType)
import Gargantext.Prelude
......
......@@ -66,10 +66,10 @@ import Gargantext.Core.Types.Main
import Gargantext.Database.Action.Flow.List
import Gargantext.Database.Action.Flow.Types
import Gargantext.Database.Action.Flow.Utils (insertDocNgrams)
import Gargantext.Database.Action.Query.Node
import Gargantext.Database.Action.Query.Node.Contact -- (HyperdataContact(..), ContactWho(..))
import Gargantext.Database.Action.Query.Node.Document.Insert -- (insertDocuments, ReturnId(..), addUniqIdsDoc, addUniqIdsContact, ToDbData(..))
import Gargantext.Database.Action.Query.Tree.Root (getOrMkRoot, getOrMk_RootWithCorpus)
import Gargantext.Database.Query.Table.Node
import Gargantext.Database.Query.Table.Node.Contact -- (HyperdataContact(..), ContactWho(..))
import Gargantext.Database.Query.Table.Node.Document.Insert -- (insertDocuments, ReturnId(..), addUniqIdsDoc, addUniqIdsContact, ToDbData(..))
import Gargantext.Database.Query.Tree.Root (getOrMkRoot, getOrMk_RootWithCorpus)
import Gargantext.Database.Action.Search (searchInDatabase)
import Gargantext.Database.Admin.Config (userMaster, corpusMasterName)
import Gargantext.Database.Admin.Types.Errors (HasNodeError(..))
......@@ -90,7 +90,7 @@ import Gargantext.Text.Terms
import GHC.Generics (Generic)
import System.FilePath (FilePath)
import qualified Data.Map as Map
import qualified Gargantext.Database.Action.Query.Node.Document.Add as Doc (add)
import qualified Gargantext.Database.Query.Table.Node.Document.Add as Doc (add)
import qualified Gargantext.Text.Corpus.API as API
------------------------------------------------------------------------
......
......@@ -48,7 +48,7 @@ import qualified Data.List as List
import qualified Data.Map as Map
import qualified Data.Set as Set
import Gargantext.Database.Action.Metrics.NgramsByNode
import Gargantext.Database.Action.Query.Tree.Root (getOrMk_RootWithCorpus)
import Gargantext.Database.Query.Tree.Root (getOrMk_RootWithCorpus)
-- FLOW LIST
-- 1. select specific terms of the corpus when compared with others langs
......
......@@ -29,12 +29,12 @@ import Gargantext.Core.Types (TableResult(..))
import Gargantext.Database.Action.Flow.Utils
import Gargantext.Database.Admin.Types.Node (AnnuaireId, CorpusId, ListId{-, DocId, ContactId-})
import Gargantext.Database.Admin.Utils (Cmd, runPGSQuery)
import Gargantext.Database.Action.Query.Node.Children (getAllContacts)
import Gargantext.Database.Action.Query.Node.Contact -- (HyperdataContact(..))
import Gargantext.Database.Query.Table.Node.Children (getAllContacts)
import Gargantext.Database.Query.Table.Node.Contact -- (HyperdataContact(..))
import Gargantext.Database.Schema.Ngrams -- (NgramsType(..))
import Gargantext.Prelude hiding (sum)
import Safe (lastMay)
import qualified Data.Map as DM
import qualified Data.Map as DM
import qualified Data.Text as DT
-- TODO mv this type in Types Main
......
......@@ -30,7 +30,7 @@ import Gargantext.Text.Terms
import Gargantext.API.Ngrams (HasRepoVar, RepoCmdM)
import Gargantext.Database.Admin.Types.Errors (HasNodeError)
import Gargantext.Database.Admin.Utils (CmdM)
import Gargantext.Database.Action.Query.Node.Document.Insert
import Gargantext.Database.Query.Table.Node.Document.Insert
type FlowCmdM env err m =
( CmdM env err m
......
......@@ -19,14 +19,13 @@ module Gargantext.Database.Action.Flow.Utils
import Data.Map (Map)
import Gargantext.Core.Types.Individu (User(..))
import Gargantext.Database.Action.Query.Node
import Gargantext.Database.Action.Query.User
import Gargantext.Database.Query.Table.Node
import Gargantext.Database.Query.Table.User
import Gargantext.Database.Admin.Types.Errors
import Gargantext.Database.Admin.Types.Node
import Gargantext.Database.Admin.Utils (Cmd)
import Gargantext.Database.Schema.Ngrams
import Gargantext.Database.Schema.Node
import Gargantext.Database.Schema.User
import Gargantext.Database.Schema.NodeNodeNgrams
import Gargantext.Prelude
import qualified Data.Map as DM
......
......@@ -23,7 +23,7 @@ import Data.Maybe
import Data.Text (Text)
import Data.Tuple (snd)
import Gargantext.Core.Types (Offset, Limit)
import Gargantext.Database.Action.Query.Facet
import Gargantext.Database.Query.Facet
import Gargantext.Database.Admin.Types.Node
import Gargantext.Database.Admin.Utils (Cmd)
import Gargantext.Prelude
......
......@@ -25,10 +25,10 @@ import Gargantext.API.Ngrams.Tools (filterListWithRoot, groupNodesByNgrams, Diag
import Gargantext.Core.Types (ListType(..), Limit, NodeType(..))
import Gargantext.Database.Action.Flow (FlowCmdM)
import Gargantext.Database.Action.Metrics.NgramsByNode (getNodesByNgramsOnlyUser{-, getTficfWith-})
import Gargantext.Database.Action.Query.Node.Select
import Gargantext.Database.Admin.Config (userMaster)
import Gargantext.Database.Admin.Types.Node (ListId, CorpusId{-, HyperdataCorpus-})
import Gargantext.Database.Action.Query.Node (defaultList)
import Gargantext.Database.Query.Table.Node (defaultList)
import Gargantext.Database.Query.Table.Node.Select
import Gargantext.Prelude
import Gargantext.Text.Metrics (scored, Scored(..), {-localMetrics, toScored-})
import qualified Data.Map as Map
......
......@@ -28,9 +28,9 @@ import Data.Time (UTCTime)
import Database.PostgreSQL.Simple (Query)
import Database.PostgreSQL.Simple.ToField
import Gargantext.Core.Types
import Gargantext.Database.Action.Query.Facet
import Gargantext.Database.Action.Query.Join (leftJoin6)
import Gargantext.Database.Action.Query.Node
import Gargantext.Database.Query.Facet
import Gargantext.Database.Query.Join (leftJoin6)
import Gargantext.Database.Query.Table.Node
import Gargantext.Database.Admin.Config (nodeTypeId)
import Gargantext.Database.Admin.Types.Node (NodeType(..))
import Gargantext.Database.Admin.Utils (Cmd, runPGSQuery, runOpaQuery, runCountOpaQuery)
......
......@@ -78,15 +78,13 @@ module Gargantext.Database.Admin.Bashql () {-( get
where
import Control.Monad.Reader -- (Reader, ask)
import Data.Text (Text)
import Data.List (concat, last)
import Gargantext.Core.Types
import Gargantext.Database.Admin.Utils (runOpaQuery, Cmd)
import Gargantext.Database.Schema.Node
import Gargantext.Database.Action.Query.Node
import qualified Gargantext.Database.Action.Query.Node.Update as U (Update(..), update)
import Gargantext.Database.Query.Table.Node
import qualified Gargantext.Database.Query.Table.Node.Update as U (Update(..), update)
import Gargantext.Prelude
......
{-|
Module : Gargantext.Database.Action.Query
Module : Gargantext.Database.Query
Description : Main Tools of Node to the database
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
......@@ -24,12 +24,12 @@ Portability : POSIX
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Gargantext.Database.Action.Query
module Gargantext.Database.Query
where
import Gargantext.Core.Types (Name)
import Gargantext.Database.Action.Query.Node
import Gargantext.Database.Action.Query.Node.User
import Gargantext.Database.Query.Table.Node
import Gargantext.Database.Query.Table.Node.User
import Gargantext.Database.Admin.Types.Errors
import Gargantext.Database.Admin.Types.Node
import Gargantext.Database.Admin.Utils (Cmd)
......
{-|
Module : Gargantext.Database.Facet
Module : Gargantext.Database.Query.Facet
Description : Main requests of Node to the database
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
......@@ -25,7 +25,7 @@ Portability : POSIX
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
------------------------------------------------------------------------
module Gargantext.Database.Action.Query.Facet
module Gargantext.Database.Query.Facet
( runViewAuthorsDoc
, runViewDocuments
, filterWith
......@@ -54,8 +54,8 @@ import Data.Time.Segment (jour)
import GHC.Generics (Generic)
import Gargantext.Core.Types
import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger)
import Gargantext.Database.Action.Query.Filter
import Gargantext.Database.Action.Query.Join (leftJoin5)
import Gargantext.Database.Query.Filter
import Gargantext.Database.Query.Join (leftJoin5)
import Gargantext.Database.Admin.Config (nodeTypeId)
import Gargantext.Database.Admin.Utils
import Gargantext.Database.Schema.Ngrams
......
......@@ -19,7 +19,7 @@ Portability : POSIX
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Gargantext.Database.Action.Query.Filter
module Gargantext.Database.Query.Filter
where
import Gargantext.Core.Types (Limit, Offset)
......
......@@ -28,7 +28,7 @@ Multiple Join functions with Opaleye.
------------------------------------------------------------------------
module Gargantext.Database.Action.Query.Join
module Gargantext.Database.Query.Join
where
import Control.Applicative ((<*>))
......
{-|
Module : Gargantext.Database.Tools.Node
Module : Gargantext.Database.Query.Table.Node
Description : Main Tools of Node to the database
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
......@@ -24,7 +24,7 @@ Portability : POSIX
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Gargantext.Database.Action.Query.Node
module Gargantext.Database.Query.Table.Node
where
import Control.Arrow (returnA)
......@@ -34,12 +34,12 @@ import Data.Maybe (Maybe(..), fromMaybe)
import Data.Text (Text)
import GHC.Int (Int64)
import Gargantext.Core.Types
import Gargantext.Database.Action.Query.Filter (limit', offset')
import Gargantext.Database.Query.Filter (limit', offset')
import Gargantext.Database.Admin.Config (nodeTypeId)
import Gargantext.Database.Admin.Types.Errors
import Gargantext.Database.Admin.Types.Node (NodeType(..), defaultCorpus, Hyperdata, HyperData(..))
import Gargantext.Database.Admin.Utils
import Gargantext.Database.Action.Query.Node.Contact (HyperdataContact(..), arbitraryHyperdataContact)
import Gargantext.Database.Query.Table.Node.Contact (HyperdataContact(..), arbitraryHyperdataContact)
import Gargantext.Database.Schema.Node
import Gargantext.Prelude hiding (sum, head)
import Gargantext.Viz.Graph (HyperdataGraph(..))
......
{-|
Module : Gargantext.Database.Node.Children
Module : Gargantext.Database.Query.Table.Node.Children
Description : Main requests of Node to the database
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
......@@ -16,15 +16,15 @@ Portability : POSIX
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
module Gargantext.Database.Action.Query.Node.Children
module Gargantext.Database.Query.Table.Node.Children
where
import Control.Arrow (returnA)
import Data.Proxy
import Gargantext.Core.Types
import Gargantext.Database.Action.Query.Filter
import Gargantext.Database.Action.Query.Node
import Gargantext.Database.Action.Query.Node.Contact (HyperdataContact)
import Gargantext.Database.Query.Filter
import Gargantext.Database.Query.Table.Node
import Gargantext.Database.Query.Table.Node.Contact (HyperdataContact)
import Gargantext.Database.Admin.Config (nodeTypeId)
import Gargantext.Database.Admin.Types.Node (pgNodeId)
import Gargantext.Database.Admin.Utils
......
{-|
Module : Gargantext.Database.Node.Contact
Module : Gargantext.Database.Query.Table.Node.Contact
Description : Update Node in Database (Postgres)
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
......@@ -17,7 +17,7 @@ Portability : POSIX
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
module Gargantext.Database.Action.Query.Node.Contact
module Gargantext.Database.Query.Table.Node.Contact
where
import Control.Lens (makeLenses)
......
......@@ -23,7 +23,7 @@ Add Documents/Contact to a Corpus/Annuaire.
{-# LANGUAGE TypeSynonymInstances #-}
------------------------------------------------------------------------
module Gargantext.Database.Action.Query.Node.Document.Add
module Gargantext.Database.Query.Table.Node.Document.Add
where
import Data.ByteString.Internal (ByteString)
......
......@@ -57,7 +57,7 @@ the concatenation of the parameters defined by @shaParameters@.
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeSynonymInstances #-}
------------------------------------------------------------------------
module Gargantext.Database.Action.Query.Node.Document.Insert
module Gargantext.Database.Query.Table.Node.Document.Insert
where
import Control.Lens (set, view)
......@@ -73,7 +73,7 @@ import Database.PostgreSQL.Simple.SqlQQ
import Database.PostgreSQL.Simple.ToField (toField, Action)
import Database.PostgreSQL.Simple.Types (Values(..), QualifiedIdentifier(..))
import GHC.Generics (Generic)
import Gargantext.Database.Action.Query.Node.Contact -- (HyperdataContact(..), ContactWho(..))
import Gargantext.Database.Query.Table.Node.Contact -- (HyperdataContact(..), ContactWho(..))
import Gargantext.Database.Admin.Config (nodeTypeId)
import Gargantext.Database.Admin.Types.Node
import Gargantext.Database.Admin.Utils (Cmd, runPGSQuery)
......
......@@ -14,7 +14,7 @@ Portability : POSIX
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
module Gargantext.Database.Action.Query.Node.Select
module Gargantext.Database.Query.Table.Node.Select
where
import Control.Arrow (returnA)
......@@ -24,7 +24,7 @@ import Gargantext.Database.Admin.Config
import Gargantext.Database.Admin.Utils
import Gargantext.Database.Schema.Node
import Gargantext.Database.Schema.User
import Gargantext.Database.Action.Query.User
import Gargantext.Database.Query.Table.User
import Opaleye
selectNodesWithUsername :: NodeType -> Username -> Cmd err [NodeId]
......
......@@ -15,7 +15,7 @@ Portability : POSIX
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RankNTypes #-}
module Gargantext.Database.Action.Query.Node.Update (Update(..), update)
module Gargantext.Database.Query.Table.Node.Update (Update(..), update)
where
import qualified Data.Text as DT
......
......@@ -16,7 +16,7 @@ Portability : POSIX
{-# LANGUAGE RankNTypes #-}
module Gargantext.Database.Action.Query.Node.UpdateOpaleye
module Gargantext.Database.Query.Table.Node.UpdateOpaleye
where
......
......@@ -19,7 +19,7 @@ Portability : POSIX
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module Gargantext.Database.Action.Query.Node.User
module Gargantext.Database.Query.Table.Node.User
where
import Control.Lens (makeLenses)
......@@ -32,13 +32,13 @@ import GHC.Generics (Generic)
import Gargantext.Core (Lang(..))
import Gargantext.Core.Types (Name)
import Gargantext.Core.Types.Individu
import Gargantext.Database.Admin.Types.Node (NodeType(..))
import Gargantext.Database.Action.Query.Node
import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger)
import Gargantext.Database.Admin.Types.Node (pgNodeId)
import Gargantext.Database.Action.Query.Node.Contact (HyperdataContact, fake_HyperdataContact)
import Gargantext.Database.Admin.Types.Node (Node,Hyperdata, DocumentId, NodeId(..))
import Gargantext.Database.Admin.Types.Node (NodeType(..))
import Gargantext.Database.Admin.Types.Node (pgNodeId)
import Gargantext.Database.Admin.Utils -- (fromField', Cmd)
import Gargantext.Database.Query.Table.Node
import Gargantext.Database.Query.Table.Node.Contact (HyperdataContact, fake_HyperdataContact)
import Gargantext.Database.Schema.Node -- (Node(..))
import Gargantext.Prelude
import Opaleye hiding (FromField)
......
{-|
Module : Gargantext.Database.user
Module : Gargantext.Database.Query.Table.User
Description : User Database management tools
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
......@@ -23,7 +23,12 @@ Functions to deal with users, database side.
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Gargantext.Database.Action.Query.User
module Gargantext.Database.Query.Table.User
( insertUsers
, queryUserTable
, getUser
, module Gargantext.Database.Schema.User
)
where
import Control.Arrow (returnA)
......
......@@ -18,7 +18,7 @@ Let a Root Node, return the Tree of the Node as a directed acyclic graph
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RankNTypes #-}
module Gargantext.Database.Action.Query.Tree
module Gargantext.Database.Query.Tree
where
import Control.Lens (Prism', (#), (^..), at, each, _Just, to)
......@@ -35,15 +35,12 @@ import Gargantext.Database.Admin.Utils (Cmd, runPGSQuery)
import Gargantext.Prelude
------------------------------------------------------------------------
-- TODO more generic find fun
findCorpus :: RootId -> Cmd err (Maybe CorpusId)
findCorpus r = do
_mapNodes <- toTreeParent <$> dbTree r []
pure Nothing
------------------------------------------------------------------------
data TreeError = NoRoot | EmptyRoot | TooManyRoots
deriving (Show)
......
......@@ -24,7 +24,7 @@ Portability : POSIX
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module Gargantext.Database.Action.Query.Tree.Root
module Gargantext.Database.Query.Tree.Root
where
import Data.Either (Either, fromLeft, fromRight)
......@@ -34,14 +34,13 @@ import Gargantext.Core.Types.Individu (User(..))
import Gargantext.Database.Admin.Config (nodeTypeId, userMaster)
import Gargantext.Database.Admin.Types.Errors
import Gargantext.Database.Admin.Types.Node
import Gargantext.Database.Action.Query.Node
import Gargantext.Database.Action.Query.Node.User (HyperdataUser)
import Gargantext.Database.Query.Table.Node
import Gargantext.Database.Query.Table.Node.User (HyperdataUser)
import Gargantext.Database.Action.Flow.Utils (getUserId)
import Gargantext.Database.Schema.Node (NodePoly(..), NodeRead)
import Gargantext.Database.Schema.Node (queryNodeTable)
import Gargantext.Database.Action.Query
import Gargantext.Database.Schema.User (UserPoly(..))
import Gargantext.Database.Action.Query.User (queryUserTable)
import Gargantext.Database.Query
import Gargantext.Database.Query.Table.User (queryUserTable, UserPoly(..))
import Gargantext.Database.Admin.Types.Node (Node, NodeType(NodeUser), pgNodeId)
import Gargantext.Database.Admin.Utils (Cmd, runOpaQuery)
import Gargantext.Prelude
......
......@@ -23,7 +23,7 @@ import Codec.Serialise
import Data.Maybe (Maybe, catMaybes)
import Data.Text (Text)
import GHC.Generics (Generic)
import Gargantext.Database.Action.Query.Node.Contact -- (HyperdataContact, ContactWho, ContactWhere, ContactTouch, ContactMetaData)
import Gargantext.Database.Query.Table.Node.Contact -- (HyperdataContact, ContactWho, ContactWhere, ContactTouch, ContactMetaData)
import Gargantext.Prelude
import System.IO (FilePath)
import qualified Data.ByteString.Lazy as BSL
......
......@@ -23,11 +23,11 @@ import Data.Map (toList)
import Data.Text (Text)
import GHC.Generics (Generic)
import Gargantext.Core.Types.Main
import Gargantext.Database.Action.Query.Node.Select
import Gargantext.Database.Action.Query.Node
import Gargantext.Database.Admin.Config
import Gargantext.Database.Admin.Types.Node (CorpusId)
import Gargantext.Database.Admin.Utils
import Gargantext.Database.Query.Table.Node
import Gargantext.Database.Query.Table.Node.Select
import Gargantext.Database.Query.Table.NodeNode (selectDocsDates)
import Gargantext.Database.Schema.Node
import Gargantext.Prelude
......
......@@ -48,12 +48,12 @@ import Gargantext.Database.Admin.Config
import Gargantext.Database.Action.Metrics.NgramsByNode (getNodesByNgramsOnlyUser)
import Gargantext.Database.Schema.Node (node_userId, node_parentId, node_hyperdata)
import Gargantext.Database.Schema.Ngrams
import Gargantext.Database.Action.Query.Node.Select
import Gargantext.Database.Action.Query.Node
import Gargantext.Database.Action.Query.Node.User
import Gargantext.Database.Query.Table.Node.Select
import Gargantext.Database.Query.Table.Node
import Gargantext.Database.Query.Table.Node.User
import Gargantext.Database.Admin.Types.Errors (HasNodeError)
import Gargantext.Database.Admin.Types.Node hiding (node_id) -- (GraphId, ListId, CorpusId, NodeId)
import Gargantext.Database.Action.Query.Node.UpdateOpaleye (updateHyperdata)
import Gargantext.Database.Query.Table.Node.UpdateOpaleye (updateHyperdata)
import Gargantext.Database.Admin.Utils (Cmd)
import Gargantext.Prelude
import qualified Gargantext.Prelude as P
......
......@@ -31,7 +31,7 @@ import qualified Data.ByteString.Lazy as DBL
import Data.Swagger
import Gargantext.API.Admin.Types
import Gargantext.Database.Schema.Node (_node_hyperdata)
import Gargantext.Database.Action.Query.Node (insertNodes, nodePhyloW, getNodePhylo)
import Gargantext.Database.Query.Table.Node (insertNodes, nodePhyloW, getNodePhylo)
import Gargantext.Database.Admin.Types.Node -- (PhyloId, ListId, CorpusId, UserId, NodeId(..))
import Gargantext.Prelude
import Gargantext.Viz.Phylo
......
......@@ -28,7 +28,7 @@ import Gargantext.API.Ngrams.Tools (getTermsWith)
import Gargantext.Core.Types
import Gargantext.Database.Action.Flow
import Gargantext.Database.Schema.Ngrams (NgramsType(..))
import Gargantext.Database.Action.Query.Node(defaultList)
import Gargantext.Database.Query.Table.Node(defaultList)
import Gargantext.Database.Query.Table.NodeNode (selectDocs)
import Gargantext.Prelude
import Gargantext.Text.Context (TermList)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment