Commit 4f736fc9 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Database] NodeNgramsNgrams cosmetics.

parent 83f88386
Pipeline #82 canceled with stage
...@@ -41,6 +41,7 @@ import Data.Profunctor.Product.TH (makeAdaptorAndInstance) ...@@ -41,6 +41,7 @@ import Data.Profunctor.Product.TH (makeAdaptorAndInstance)
import Database.PostgreSQL.Simple.SqlQQ (sql) import Database.PostgreSQL.Simple.SqlQQ (sql)
import Database.PostgreSQL.Simple.Types (Values(..), QualifiedIdentifier(..)) import Database.PostgreSQL.Simple.Types (Values(..), QualifiedIdentifier(..))
import Gargantext.Database.Utils (Cmd, runOpaQuery, runPGSQuery, connection) import Gargantext.Database.Utils (Cmd, runOpaQuery, runPGSQuery, connection)
import Gargantext.Core.Types.Main (ListId)
import Gargantext.Prelude import Gargantext.Prelude
import Opaleye import Opaleye
import qualified Database.PostgreSQL.Simple as PGS import qualified Database.PostgreSQL.Simple as PGS
...@@ -52,7 +53,6 @@ data NodeNgramsNgramsPoly node_id ngram1_id ngram2_id weight = ...@@ -52,7 +53,6 @@ data NodeNgramsNgramsPoly node_id ngram1_id ngram2_id weight =
, _nng_Weight :: weight , _nng_Weight :: weight
} deriving (Show) } deriving (Show)
type NodeNgramsNgramsWrite = type NodeNgramsNgramsWrite =
NodeNgramsNgramsPoly (Column PGInt4 ) NodeNgramsNgramsPoly (Column PGInt4 )
(Column PGInt4 ) (Column PGInt4 )
...@@ -124,9 +124,9 @@ data Action = Del | Add ...@@ -124,9 +124,9 @@ data Action = Del | Add
type NgramsParent = Text type NgramsParent = Text
type NgramsChild = Text type NgramsChild = Text
ngramsGroup' :: Action -> [(Int, NgramsParent, NgramsChild, Maybe Double)] ngramsGroup :: Action -> [(ListId, NgramsParent, NgramsChild, Maybe Double)]
-> Cmd err [Int] -> Cmd err [Int]
ngramsGroup' action ngs = runNodeNgramsNgrams q ngs ngramsGroup action ngs = runNodeNgramsNgrams q ngs
where where
q = case action of q = case action of
Del -> queryDelNodeNgramsNgrams Del -> queryDelNodeNgramsNgrams
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment