2 Module : Gargantext.Database.Init
3 Description : Triggers configuration
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
10 Ngrams by node enable contextual metrics.
14 {-# LANGUAGE FlexibleContexts #-}
15 {-# LANGUAGE QuasiQuotes #-}
16 {-# LANGUAGE NoImplicitPrelude #-}
17 {-# LANGUAGE OverloadedStrings #-}
18 {-# LANGUAGE RankNTypes #-}
20 module Gargantext.Database.Init
23 -- import Database.PostgreSQL.Simple.Types (Values(..), QualifiedIdentifier(..))
24 import Gargantext.Database.Utils (Cmd)
25 import Gargantext.Prelude
26 import Gargantext.Database.Triggers.Nodes (triggerSearchUpdate)
27 import Gargantext.Database.Triggers.NodesNodes (triggerDeleteCount, triggerInsertCount, triggerUpdateAdd, triggerUpdateDel, MasterListId) -- , triggerCoocInsert)
28 import Gargantext.Database.Triggers.NodeNodeNgrams (triggerCountInsert, triggerCountInsert2)
29 ------------------------------------------------------------------------
31 initTriggers :: MasterListId -> Cmd err [Int64]
33 t0 <- triggerSearchUpdate
34 t1 <- triggerCountInsert
35 t1' <- triggerCountInsert2
36 -- t1'' <- triggerCoocInsert lId
37 t2 <- triggerDeleteCount lId
38 t3 <- triggerInsertCount lId
39 t4 <- triggerUpdateAdd lId
40 t5 <- triggerUpdateDel lId