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
153
Issues
153
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
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
b89fdced
Commit
b89fdced
authored
Dec 13, 2024
by
Grégoire Locqueville
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed dead NodeStory-related code
parent
3e17e11f
Pipeline
#7134
passed with stages
in 39 minutes and 51 seconds
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
189 deletions
+4
-189
NodeStory.hs
src/Gargantext/Core/NodeStory.hs
+2
-160
DB.hs
src/Gargantext/Core/NodeStory/DB.hs
+2
-18
Types.hs
src/Gargantext/Core/NodeStory/Types.hs
+0
-11
No files found.
src/Gargantext/Core/NodeStory.hs
View file @
b89fdced
This diff is collapsed.
Click to expand it.
src/Gargantext/Core/NodeStory/DB.hs
View file @
b89fdced
...
...
@@ -14,9 +14,7 @@ Portability : POSIX
{-# LANGUAGE QuasiQuotes #-}
module
Gargantext.Core.NodeStory.DB
(
nodeExists
,
getNodesIdWithType
,
getNodesArchiveHistory
(
getNodesArchiveHistory
,
insertNodeArchiveHistory
,
nodeStoriesQuery
,
insertArchiveStateList
...
...
@@ -33,29 +31,15 @@ import Database.PostgreSQL.Simple qualified as PGS
import
Database.PostgreSQL.Simple.SqlQQ
(
sql
)
import
Database.PostgreSQL.Simple.Types
(
Values
(
..
),
QualifiedIdentifier
(
..
))
import
Gargantext.API.Ngrams.Types
import
Gargantext.Core
(
toDBid
)
import
Gargantext.Core.NodeStory.Types
(
a_state
,
a_version
,
ArchiveList
,
ArchiveStateList
,
NgramsStatePatch
'
)
import
Gargantext.Core.Text.Ngrams
(
NgramsType
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
(
..
)
,
NodeType
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
(
..
)
)
import
Gargantext.Database.Admin.Config
()
import
Gargantext.Database.Schema.Ngrams
()
import
Gargantext.Prelude
hiding
(
to
)
import
Gargantext.Prelude.Database
(
runPGSExecute
,
runPGSExecuteMany
,
runPGSQuery
,
runPGSReturning
)
nodeExists
::
PGS
.
Connection
->
NodeId
->
IO
Bool
nodeExists
c
nId
=
(
==
[
PGS
.
Only
True
])
<$>
runPGSQuery
c
[
sql
|
SELECT true FROM nodes WHERE id = ? LIMIT 1
|]
(
PGS
.
Only
nId
)
getNodesIdWithType
::
PGS
.
Connection
->
NodeType
->
IO
[
NodeId
]
getNodesIdWithType
c
nt
=
do
ns
<-
runPGSQuery
c
query
(
PGS
.
Only
$
toDBid
nt
)
pure
$
map
(
\
(
PGS
.
Only
nId
)
->
UnsafeMkNodeId
nId
)
ns
where
query
::
PGS
.
Query
query
=
[
sql
|
SELECT id FROM nodes WHERE typename = ?
|]
-- /!\ This function is using an hard coded parameter
-- which depends on the Ngrams List Flow
...
...
src/Gargantext/Core/NodeStory/Types.hs
View file @
b89fdced
...
...
@@ -27,7 +27,6 @@ module Gargantext.Core.NodeStory.Types
,
NodeListStory
,
ArchiveList
,
NodeStoryEnv
(
..
)
,
initNodeStory
,
nse_getter
,
nse_getter_multi
,
nse_saver_immediate
...
...
@@ -37,7 +36,6 @@ module Gargantext.Core.NodeStory.Types
,
Archive
(
..
)
,
initArchive
,
archiveAdvance
,
unionArchives
,
a_history
,
a_state
,
a_version
...
...
@@ -144,16 +142,7 @@ instance (ToJSON s, ToJSON p) => ToJSON (Archive s p) where
archiveAdvance
::
(
Semigroup
s
,
Semigroup
p
)
=>
Archive
s
p
->
Archive
s
p
->
Archive
s
p
archiveAdvance
aOld
aNew
=
aNew
{
_a_history
=
_a_history
aNew
<>
_a_history
aOld
}
-- | This is to merge archive states.
unionArchives
::
(
Semigroup
s
,
Semigroup
p
)
=>
Archive
s
p
->
Archive
s
p
->
Archive
s
p
unionArchives
aOld
aNew
=
aNew
{
_a_state
=
_a_state
aOld
<>
_a_state
aNew
,
_a_history
=
_a_history
aNew
<>
_a_history
aOld
}
------------------------------------------------------------------------
initNodeStory
::
(
Monoid
s
,
Semigroup
p
)
=>
NodeId
->
NodeStory
s
p
initNodeStory
ni
=
NodeStory
$
Map
.
singleton
ni
initArchive
initArchive
::
(
Monoid
s
,
Semigroup
p
)
=>
Archive
s
p
initArchive
=
Archive
{
_a_version
=
0
,
_a_state
=
mempty
...
...
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