2 Module : Gargantext.Database
3 Description : Tools for Database
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
10 All Database related stuff here.
12 Target: just import this module and nothing else to work with
13 Gargantext's database.
17 {-# LANGUAGE NoImplicitPrelude #-}
19 module Gargantext.Database.Config
22 import Data.Text (pack)
23 import Data.Maybe (fromMaybe)
24 import Data.List (lookup)
26 import Gargantext.Database.Types.Node
27 import Gargantext.Prelude
29 -- | Nodes are typed in the database according to a specific ID
31 nodeTypes :: [(NodeType, NodeTypeId)]
32 nodeTypes = [ (NodeUser , 1)
46 -- , (Cooccurrences , 9)
48 -- , (Specclusion , 11)
49 -- , (Genclusion , 18)
52 -- , (TfidfCorpus , 13)
53 -- , (TfidfGlobal , 14)
55 -- , (TirankLocal , 16)
56 -- , (TirankGlobal , 17)
63 nodeTypeId :: NodeType -> NodeTypeId
64 nodeTypeId tn = fromMaybe (panic $ pack $ "Typename " <> show tn <> " does not exist")