Commit 7a4a4c7d authored by Grégoire Locqueville's avatar Grégoire Locqueville

Removed module `Database.Query.Join`

The module only contained one function actually used, `leftJoin3'`, so I
I redefined it inline where it was used, and removed the module.
parent 2a514b43
Pipeline #7148 passed with stages
in 60 minutes and 4 seconds
......@@ -431,7 +431,6 @@ library
Gargantext.Database.GargDB
Gargantext.Database.Query.Facet.Types
Gargantext.Database.Query.Filter
Gargantext.Database.Query.Join
Gargantext.Database.Query.Prelude
Gargantext.Database.Query.Table.Context
Gargantext.Database.Query.Table.ContextNodeNgrams
......
This diff is collapsed.
......@@ -12,14 +12,12 @@ Portability : POSIX
------------------------------------------------------------------------
module Gargantext.Database.Query.Prelude
( module Gargantext.Database.Query.Join
, module Gargantext.Database.Query.Table.Node
( module Gargantext.Database.Query.Table.Node
, module Gargantext.Database.Query.Table.NodeNode
, module Control.Arrow
)
where
import Control.Arrow (returnA)
import Gargantext.Database.Query.Join
import Gargantext.Database.Query.Table.Node
import Gargantext.Database.Query.Table.NodeNode
......@@ -23,6 +23,7 @@ module Gargantext.Database.Query.Table.Ngrams
)
where
import Control.Arrow ((>>>))
import Data.HashMap.Strict (HashMap)
import Data.HashMap.Strict qualified as HashMap
import Data.List qualified as List
......@@ -31,7 +32,6 @@ import Database.PostgreSQL.Simple qualified as PGS
import Gargantext.Core.Text.Ngrams (Ngrams(..), NgramsType)
import Gargantext.Database.Admin.Types.Node ( pgNodeId, CorpusId, ListId, DocId )
import Gargantext.Database.Prelude (runOpaQuery, formatPGSQuery, runPGSQuery, DBCmd)
import Gargantext.Database.Query.Join (leftJoin3)
import Gargantext.Database.Query.Table.ContextNodeNgrams2
import Gargantext.Database.Query.Table.NodeNgrams (queryNodeNgramsTable)
import Gargantext.Database.Schema.Ngrams
......@@ -54,6 +54,10 @@ selectNgramsByDoc lIds dId nt = runOpaQuery (query lIds dId nt)
on1 (ng, nng, cnng) = (.&&)
(ng^.ngrams_id .== nng^.nng_ngrams_id)
(nng^.nng_id .== cnng^.cnng2_nodengrams_id)
leftJoin3 :: Select columnsA -> Select columnsB -> Select columnsC
-> ((columnsA, columnsB, columnsC) -> Column SqlBool)
-> Select (columnsA, columnsB, columnsC)
leftJoin3 q1 q2 q3 cond = ((,,) <$> q1 <*> q2 <*> q3) >>> keepWhen cond
query lIds' dId' nt' = proc () -> do
(ng,nng,cnng) <- join' -< ()
......
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