]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Schema/ContextNodeNgrams2.hs
[FEAT] Book export to CSV functions (WIP)
[gargantext.git] / src / Gargantext / Database / Schema / ContextNodeNgrams2.hs
1 {-|
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
8 Portability : POSIX
9
10 -}
11
12 {-# OPTIONS_GHC -fno-warn-orphans #-}
13
14 {-# LANGUAGE Arrows #-}
15 {-# LANGUAGE FunctionalDependencies #-}
16 {-# LANGUAGE TemplateHaskell #-}
17
18 module Gargantext.Database.Schema.ContextNodeNgrams2
19 where
20
21 import Gargantext.Database.Admin.Types.Node
22 import Gargantext.Database.Schema.NodeNgrams (NodeNgramsId)
23 import Gargantext.Database.Schema.Prelude
24 import Prelude
25
26
27 type ContextNodeNgrams2 = ContextNodeNgrams2Poly ContextId NodeNgramsId Double
28
29
30 data ContextNodeNgrams2Poly context_id nodengrams_id w
31 = ContextNodeNgrams2 { _cnng2_context_id :: !context_id
32 , _cnng2_nodengrams_id :: !nodengrams_id
33 , _cnng2_weight :: !w
34 } deriving (Show)
35
36 type ContextNodeNgrams2Write =
37 ContextNodeNgrams2Poly (Column SqlInt4 )
38 (Column SqlInt4 )
39 (Column SqlFloat8)
40
41 type ContextNodeNgrams2Read =
42 ContextNodeNgrams2Poly (Column SqlInt4 )
43 (Column SqlInt4 )
44 (Column SqlFloat8)
45
46 $(makeAdaptorAndInstance "pContextNodeNgrams2" ''ContextNodeNgrams2Poly)
47 makeLenses ''ContextNodeNgrams2Poly
48
49 contextNodeNgrams2Table :: Table ContextNodeNgrams2Write ContextNodeNgrams2Read
50 contextNodeNgrams2Table = Table "context_node_ngrams2"
51 ( pContextNodeNgrams2 ContextNodeNgrams2
52 { _cnng2_context_id = requiredTableField "context_id"
53 , _cnng2_nodengrams_id = requiredTableField "nodengrams_id"
54 , _cnng2_weight = requiredTableField "weight"
55 }
56 )