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
199
Issues
199
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
50585129
Commit
50585129
authored
Dec 08, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Database] Clean duplicate functions
parent
5c9f985b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
Node.hs
src/Gargantext/Database/Schema/Node.hs
+7
-4
No files found.
src/Gargantext/Database/Schema/Node.hs
View file @
50585129
...
...
@@ -31,7 +31,7 @@ import Data.Aeson
import
Data.ByteString
(
ByteString
)
import
Data.Maybe
(
Maybe
(
..
),
fromMaybe
)
import
Data.Profunctor.Product.TH
(
makeAdaptorAndInstance
)
import
Data.Text
(
Text
,
unpack
,
pack
)
import
Data.Text
(
Text
,
pack
)
import
Data.Time
(
UTCTime
)
import
Database.PostgreSQL.Simple
(
Connection
)
import
Database.PostgreSQL.Simple.FromField
(
FromField
,
fromField
)
...
...
@@ -513,7 +513,7 @@ data Node' = Node' { _n_type :: NodeType
,
_n_children
::
[
Node'
]
}
deriving
(
Show
)
-- | TODO
mv in Database.Schema and factor
-- | TODO
NodeWriteT -> NodeWrite
type
NodeWriteT
=
(
Maybe
(
Column
PGInt4
)
,
Column
PGInt4
,
Column
PGInt4
...
...
@@ -523,9 +523,12 @@ type NodeWriteT = ( Maybe (Column PGInt4)
,
Column
PGJsonb
)
mkNode'
::
[
NodeWrite
]
->
Cmd
Int64
mkNode'
ns
=
mkCmd
$
\
conn
->
runInsertMany
conn
nodeTable
ns
mkNode'
::
[
NodeWriteT
]
->
Cmd
Int64
mkNode'
ns
=
mkCmd
$
\
conn
->
runInsertMany
conn
nodeTable'
ns
-- TODO: replace mkNodeR'
mkNodeR''
::
[
NodeWrite
]
->
Cmd
[
Int
]
mkNodeR''
ns
=
mkCmd
$
\
conn
->
runInsertManyReturning
conn
nodeTable
ns
(
_node_id
)
mkNodeR'
::
[
NodeWriteT
]
->
Cmd
[
Int
]
mkNodeR'
ns
=
mkCmd
$
\
conn
->
runInsertManyReturning
conn
nodeTable'
ns
(
\
(
i
,
_
,
_
,
_
,
_
,
_
,
_
)
->
i
)
...
...
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