2 Module : Gargantext.Database.Schema.NodeNode
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
10 Here is a longer description of this module, containing some
11 commentary with @some markup@.
14 {-# LANGUAGE Arrows #-}
15 {-# LANGUAGE FunctionalDependencies #-}
16 {-# LANGUAGE QuasiQuotes #-}
17 {-# LANGUAGE TemplateHaskell #-}
19 module Gargantext.Database.Schema.NodeNode where
21 import Gargantext.Core.Types
22 import Gargantext.Database.Schema.Prelude
23 import Gargantext.Prelude
26 data NodeNodePoly node1_id node2_id score cat
27 = NodeNode { _nn_node1_id :: !node1_id
28 , _nn_node2_id :: !node2_id
30 , _nn_category :: !cat
33 type NodeNodeWrite = NodeNodePoly (Field SqlInt4)
35 (Maybe (Field SqlFloat8))
36 (Maybe (Field SqlInt4))
38 type NodeNodeRead = NodeNodePoly (Field SqlInt4)
43 type NodeNodeReadNull = NodeNodePoly (Field SqlInt4)
45 (FieldNullable SqlFloat8)
46 (FieldNullable SqlInt4)
48 type NodeNode = NodeNodePoly NodeId NodeId (Maybe Double) (Maybe Int)
50 $(makeAdaptorAndInstance "pNodeNode" ''NodeNodePoly)
51 makeLenses ''NodeNodePoly
53 nodeNodeTable :: Table NodeNodeWrite NodeNodeRead
57 NodeNode { _nn_node1_id = requiredTableField "node1_id"
58 , _nn_node2_id = requiredTableField "node2_id"
59 , _nn_score = optionalTableField "score"
60 , _nn_category = optionalTableField "category"