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 NodeNode = NodeNodePoly NodeId NodeId (Maybe Double) (Maybe Int)
45 $(makeAdaptorAndInstance "pNodeNode" ''NodeNodePoly)
46 makeLenses ''NodeNodePoly
48 nodeNodeTable :: Table NodeNodeWrite NodeNodeRead
52 NodeNode { _nn_node1_id = requiredTableField "node1_id"
53 , _nn_node2_id = requiredTableField "node2_id"
54 , _nn_score = optionalTableField "score"
55 , _nn_category = optionalTableField "category"