Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Przemyslaw Kaminski
haskell-gargantext
Commits
2604c7a4
Commit
2604c7a4
authored
Dec 23, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DB] insert on conclict.
parent
1114fe2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
NodeNodeNgrams.hs
src/Gargantext/Database/Schema/NodeNodeNgrams.hs
+0
-1
Node_NodeNgrams_NodeNgrams.hs
src/Gargantext/Database/Schema/Node_NodeNgrams_NodeNgrams.hs
+8
-6
No files found.
src/Gargantext/Database/Schema/NodeNodeNgrams.hs
View file @
2604c7a4
...
...
@@ -32,7 +32,6 @@ import Gargantext.Database.Types.Node
import
Opaleye
data
NodeNodeNgramsPoly
n1
n2
ngrams_id
ngt
w
=
NodeNodeNgrams
{
_nnng_node1_id
::
n1
,
_nnng_node2_id
::
n2
...
...
src/Gargantext/Database/Schema/Node_NodeNgrams_NodeNgrams.hs
View file @
2604c7a4
...
...
@@ -35,12 +35,10 @@ Next Step benchmark:
module
Gargantext.Database.Schema.Node_NodeNgrams_NodeNgrams
where
import
Control.Lens
(
view
)
import
Control.Lens.TH
(
makeLensesWith
,
abbreviatedFields
)
import
Control.Monad.IO.Class
(
liftIO
)
import
Data.Maybe
(
Maybe
)
import
Data.Profunctor.Product.TH
(
makeAdaptorAndInstance
)
import
Gargantext.Database.Utils
(
Cmd
,
runOpaQuery
,
connection
)
import
Gargantext.Database.Utils
(
Cmd
,
runOpaQuery
,
mkCmd
)
import
Gargantext.Database.Types.Node
(
CorpusId
)
import
Gargantext.Database.Schema.Node
(
pgNodeId
)
import
Gargantext.Prelude
...
...
@@ -115,6 +113,10 @@ insert_Node_NodeNgrams_NodeNgrams = insert_Node_NodeNgrams_NodeNgrams_W
)
insert_Node_NodeNgrams_NodeNgrams_W
::
[
Node_NodeNgrams_NodeNgrams_Write
]
->
Cmd
err
Int64
insert_Node_NodeNgrams_NodeNgrams_W
ns
=
do
c
<-
view
connection
liftIO
$
runInsertMany
c
node_NodeNgrams_NodeNgrams_Table
ns
insert_Node_NodeNgrams_NodeNgrams_W
ns
=
mkCmd
$
\
c
->
runInsert_
c
Insert
{
iTable
=
node_NodeNgrams_NodeNgrams_Table
,
iRows
=
ns
,
iReturning
=
rCount
,
iOnConflict
=
(
Just
DoNothing
)
}
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