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 type ContextNodeNgramsReadNull =
59 ContextNodeNgramsPoly (FieldNullable SqlInt4 )
60 (FieldNullable SqlInt4 )
61 (FieldNullable SqlInt4 )
62 (FieldNullable SqlInt4 )
63 (FieldNullable SqlFloat8)
64 (FieldNullable SqlInt4 )
66 $(makeAdaptorAndInstance "pContextNodeNgrams" ''ContextNodeNgramsPoly)
67 makeLenses ''ContextNodeNgramsPoly
70 contextNodeNgramsTable :: Table ContextNodeNgramsWrite ContextNodeNgramsRead
71 contextNodeNgramsTable = Table "context_node_ngrams"
72 ( pContextNodeNgrams ContextNodeNgrams
73 { _cnng_context_id = requiredTableField "context_id"
74 , _cnng_node_id = requiredTableField "node_id"
75 , _cnng_ngrams_id = requiredTableField "ngrams_id"
76 , _cnng_ngramsType = requiredTableField "ngrams_type"
77 , _cnng_weight = requiredTableField "weight"
78 , _cnng_doc_count = requiredTableField "doc_count"
82 -- queryContextNodeNgramsTable :: Select ContextNodeNgramsRead
83 -- queryContextNodeNgramsTable = selectTable contextNodeNgramsTable