Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
6a8cadda
Commit
6a8cadda
authored
Jul 19, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Database.Schema] NodeNode_NodeNode table
parent
867e7c47
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
2 deletions
+119
-2
schema.sql
devops/postgres/schema.sql
+0
-2
NodeNode_NodeNode.hs
src/Gargantext/Database/Query/Table/NodeNode_NodeNode.hs
+61
-0
NodeNode_NodeNode.hs
src/Gargantext/Database/Schema/NodeNode_NodeNode.hs
+58
-0
No files found.
devops/postgres/schema.sql
View file @
6a8cadda
...
...
@@ -72,8 +72,6 @@ CREATE TABLE public.node_nodengrams_nodengrams (
);
ALTER
TABLE
public
.
node_nodengrams_nodengrams
OWNER
TO
gargantua
;
--------------------------------------------------------------
--------------------------------------------------------------
--
...
...
src/Gargantext/Database/Query/Table/NodeNode_NodeNode.hs
0 → 100644
View file @
6a8cadda
{-|
Module : Gargantext.Database.Query.Table.NodeNode_NodeNode
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE Arrows #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
module
Gargantext.Database.Query.Table.NodeNode
where
import
Control.Arrow
(
returnA
)
import
Control.Lens
(
view
,
(
^.
))
import
Data.Maybe
(
catMaybes
)
import
Data.Text
(
Text
,
splitOn
)
import
Database.PostgreSQL.Simple.SqlQQ
(
sql
)
import
Database.PostgreSQL.Simple.Types
(
Values
(
..
),
QualifiedIdentifier
(
..
))
import
qualified
Database.PostgreSQL.Simple
as
PGS
(
Query
,
Only
(
..
))
import
qualified
Opaleye
as
O
import
Opaleye
import
Gargantext.Core.Types
import
Gargantext.Database.Schema.NodeNode_NodeNode
import
Gargantext.Database.Admin.Config
(
nodeTypeId
)
import
Gargantext.Database.Admin.Types.Hyperdata
import
Gargantext.Database.Admin.Types.Node
(
CorpusId
,
DocId
,
pgNodeId
)
import
Gargantext.Database.Prelude
import
Gargantext.Database.Schema.Node
import
Gargantext.Prelude
queryNodeNode_NodeNodeTable
::
Query
NodeNode_NodeNodeRead
queryNodeNode_NodeNodeTable
=
queryTable
nodeNode_NodeNodeTable
------------------------------------------------------------------------
insertNodeNode_NodeNode
::
[
NodeNode_NodeNode
]
->
Cmd
err
Int64
insertNodeNode_NodeNode
ns
=
mkCmd
$
\
conn
->
runInsert_
conn
$
Insert
nodeNode_NodeNodeTable
ns'
rCount
Nothing
where
ns'
::
[
NodeNode_NodeNodeWrite
]
ns'
=
map
(
\
(
NodeNode_NodeNode
nn1
nn2
w
)
->
NodeNode_NodeNode
(
pgInt4
nn1
)
(
pgInt4
nn1
)
(
pgDouble
<$>
x
)
)
ns
------------------------------------------------------------------------
-- | TODO delete
--
------------------------------------------------------------------------
src/Gargantext/Database/Schema/NodeNode_NodeNode.hs
0 → 100644
View file @
6a8cadda
{-|
Module : Gargantext.Database.Schema.NodeNode_NodeNode
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE Arrows #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
module
Gargantext.Database.Schema.NodeNode
where
import
Data.Maybe
(
Maybe
)
import
Gargantext.Core.Types
import
Gargantext.Database.Schema.Prelude
import
Gargantext.Prelude
data
NodeNode_NodeNodePoly
nn1
nn2
weight
=
NodeNode_NodeNode
{
_nnnn_nn1_id
::
!
nn1
,
_nnnn_nn2_id
::
!
nn2
,
_nnnn_weight
::
!
weight
}
deriving
(
Show
)
type
NodeNodeWrite
=
NodeNodePoly
(
Column
(
PGInt4
))
(
Column
(
PGInt4
))
(
Maybe
(
Column
(
PGFloat8
)))
type
NodeNodeRead
=
NodeNodePoly
(
Column
(
PGInt4
))
(
Column
(
PGInt4
))
(
Maybe
(
Column
(
PGFloat8
)))
type
NodeNodeReadNull
=
NodeNodePoly
(
Column
(
Nullable
PGInt4
))
(
Column
(
Nullable
PGInt4
))
(
Column
(
Nullable
PGFloat8
))
type
NodeNode_NodeNode
=
NodeNode_NodeNodePoly
Int
Int
(
Maybe
Double
)
$
(
makeAdaptorAndInstance
"pNodeNode_NodeNode"
''
N
odeNode_NodeNodePoly
)
makeLenses
''
N
odeNode_NodeNodePoly
nodeNode_NodeNodeTable
::
Table
NodeNode_NodeNodeWrite
NodeNode_NodeNodeRead
nodeNode_NodeNodeTable
=
Table
"nodesnodes_nodesnodes"
(
pNodeNode_NodeNode
NodeNode_NodeNode
{
_nnnn_nn1_id
=
required
"nn1_id"
,
_nnnn_nn2_id
=
required
"nn2_id"
,
_nnnn_weight
=
optional
"weight"
}
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment