2 Module : Gargantext.Database.Schema.NodeNodeNgrams
3 Description : TODO: remove this module and table in database
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
12 {-# OPTIONS_GHC -fno-warn-orphans #-}
14 {-# LANGUAGE Arrows #-}
15 {-# LANGUAGE FunctionalDependencies #-}
16 {-# LANGUAGE TemplateHaskell #-}
18 module Gargantext.Database.Schema.ContextNodeNgrams
22 import Gargantext.Core.Types (TermsCount)
23 import Gargantext.Database.Schema.Prelude
24 import Gargantext.Database.Schema.Ngrams (NgramsTypeId, NgramsId)
25 import Gargantext.Database.Admin.Types.Node
29 type ContextNodeNgrams =
30 ContextNodeNgramsPoly ContextId ListId NgramsId NgramsTypeId Double TermsCount
33 data ContextNodeNgramsPoly c n ngrams_id ngt w dc
34 = ContextNodeNgrams { _cnng_context_id :: !c
36 , _cnng_ngrams_id :: !ngrams_id
37 , _cnng_ngramsType :: !ngt
39 , _cnng_doc_count :: !dc
42 type ContextNodeNgramsWrite =
43 ContextNodeNgramsPoly (Field SqlInt4 )
50 type ContextNodeNgramsRead =
51 ContextNodeNgramsPoly (Field SqlInt4 )
58 $(makeAdaptorAndInstance "pContextNodeNgrams" ''ContextNodeNgramsPoly)
59 makeLenses ''ContextNodeNgramsPoly
62 contextNodeNgramsTable :: Table ContextNodeNgramsWrite ContextNodeNgramsRead
63 contextNodeNgramsTable = Table "context_node_ngrams"
64 ( pContextNodeNgrams ContextNodeNgrams
65 { _cnng_context_id = requiredTableField "context_id"
66 , _cnng_node_id = requiredTableField "node_id"
67 , _cnng_ngrams_id = requiredTableField "ngrams_id"
68 , _cnng_ngramsType = requiredTableField "ngrams_type"
69 , _cnng_weight = requiredTableField "weight"
70 , _cnng_doc_count = requiredTableField "doc_count"
74 -- queryContextNodeNgramsTable :: Select ContextNodeNgramsRead
75 -- queryContextNodeNgramsTable = selectTable contextNodeNgramsTable