]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Schema/NodeNodeNgrams2.hs
[DB/FACT] Schema NodeNodeNgrams -> Query (with warnings)
[gargantext.git] / src / Gargantext / Database / Schema / NodeNodeNgrams2.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 FlexibleContexts #-}
16 {-# LANGUAGE FlexibleInstances #-}
17 {-# LANGUAGE FunctionalDependencies #-}
18 {-# LANGUAGE MultiParamTypeClasses #-}
19 {-# LANGUAGE NoImplicitPrelude #-}
20 {-# LANGUAGE RankNTypes #-}
21 {-# LANGUAGE TemplateHaskell #-}
22
23 module Gargantext.Database.Schema.NodeNodeNgrams2
24 where
25
26 import Gargantext.Database.Schema.Prelude
27 import Gargantext.Database.Schema.NodeNgrams (NodeNgramsId)
28 import Gargantext.Database.Admin.Types.Node (pgNodeId)
29 import Gargantext.Database.Admin.Types.Node
30 import Prelude
31
32 data NodeNodeNgrams2Poly node_id nodengrams_id w
33 = NodeNodeNgrams2 { _nnng2_node_id :: !node_id
34 , _nnng2_nodengrams_id :: !nodengrams_id
35 , _nnng2_weight :: !w
36 } deriving (Show)
37
38 type NodeNodeNgrams2Write =
39 NodeNodeNgrams2Poly (Column PGInt4 )
40 (Column PGInt4 )
41 (Column PGFloat8)
42
43 type NodeNodeNgrams2Read =
44 NodeNodeNgrams2Poly (Column PGInt4 )
45 (Column PGInt4 )
46 (Column PGFloat8)
47
48 type NodeNodeNgrams2ReadNull =
49 NodeNodeNgrams2Poly (Column (Nullable PGInt4 ))
50 (Column (Nullable PGInt4 ))
51 (Column (Nullable PGFloat8))
52
53 type NodeNodeNgrams2 =
54 NodeNodeNgrams2Poly DocId NodeNgramsId Double
55
56 $(makeAdaptorAndInstance "pNodeNodeNgrams2" ''NodeNodeNgrams2Poly)
57 makeLenses ''NodeNodeNgrams2Poly
58
59 nodeNodeNgrams2Table :: Table NodeNodeNgrams2Write NodeNodeNgrams2Read
60 nodeNodeNgrams2Table = Table "node_node_ngrams2"
61 ( pNodeNodeNgrams2 NodeNodeNgrams2
62 { _nnng2_node_id = required "node_id"
63 , _nnng2_nodengrams_id = required "nodengrams_id"
64 , _nnng2_weight = required "weight"
65 }
66 )
67