]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Schema/NodeNodeNgrams2.hs
[REPL sugar] runCmdReplEasy
[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
29 import Prelude
30
31 data NodeNodeNgrams2Poly node_id nodengrams_id w
32 = NodeNodeNgrams2 { _nnng2_node_id :: !node_id
33 , _nnng2_nodengrams_id :: !nodengrams_id
34 , _nnng2_weight :: !w
35 } deriving (Show)
36
37 type NodeNodeNgrams2Write =
38 NodeNodeNgrams2Poly (Column PGInt4 )
39 (Column PGInt4 )
40 (Column PGFloat8)
41
42 type NodeNodeNgrams2Read =
43 NodeNodeNgrams2Poly (Column PGInt4 )
44 (Column PGInt4 )
45 (Column PGFloat8)
46
47 type NodeNodeNgrams2ReadNull =
48 NodeNodeNgrams2Poly (Column (Nullable PGInt4 ))
49 (Column (Nullable PGInt4 ))
50 (Column (Nullable PGFloat8))
51
52 type NodeNodeNgrams2 =
53 NodeNodeNgrams2Poly DocId NodeNgramsId Double
54
55 $(makeAdaptorAndInstance "pNodeNodeNgrams2" ''NodeNodeNgrams2Poly)
56 makeLenses ''NodeNodeNgrams2Poly
57
58 nodeNodeNgrams2Table :: Table NodeNodeNgrams2Write NodeNodeNgrams2Read
59 nodeNodeNgrams2Table = Table "node_node_ngrams2"
60 ( pNodeNodeNgrams2 NodeNodeNgrams2
61 { _nnng2_node_id = required "node_id"
62 , _nnng2_nodengrams_id = required "nodengrams_id"
63 , _nnng2_weight = required "weight"
64 }
65 )
66