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 ...@@ -431,7 +431,6 @@ library
Gargantext.Database.GargDB Gargantext.Database.GargDB
Gargantext.Database.Query.Facet.Types Gargantext.Database.Query.Facet.Types
Gargantext.Database.Query.Filter Gargantext.Database.Query.Filter
Gargantext.Database.Query.Join
Gargantext.Database.Query.Prelude Gargantext.Database.Query.Prelude
Gargantext.Database.Query.Table.Context Gargantext.Database.Query.Table.Context
Gargantext.Database.Query.Table.ContextNodeNgrams Gargantext.Database.Query.Table.ContextNodeNgrams
......
This diff is collapsed.
...@@ -12,14 +12,12 @@ Portability : POSIX ...@@ -12,14 +12,12 @@ Portability : POSIX
------------------------------------------------------------------------ ------------------------------------------------------------------------
module Gargantext.Database.Query.Prelude 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 Gargantext.Database.Query.Table.NodeNode
, module Control.Arrow , module Control.Arrow
) )
where where
import Control.Arrow (returnA) import Control.Arrow (returnA)
import Gargantext.Database.Query.Join
import Gargantext.Database.Query.Table.Node import Gargantext.Database.Query.Table.Node
import Gargantext.Database.Query.Table.NodeNode import Gargantext.Database.Query.Table.NodeNode
...@@ -23,6 +23,7 @@ module Gargantext.Database.Query.Table.Ngrams ...@@ -23,6 +23,7 @@ module Gargantext.Database.Query.Table.Ngrams
) )
where where
import Control.Arrow ((>>>))
import Data.HashMap.Strict (HashMap) import Data.HashMap.Strict (HashMap)
import Data.HashMap.Strict qualified as HashMap import Data.HashMap.Strict qualified as HashMap
import Data.List qualified as List import Data.List qualified as List
...@@ -31,7 +32,6 @@ import Database.PostgreSQL.Simple qualified as PGS ...@@ -31,7 +32,6 @@ import Database.PostgreSQL.Simple qualified as PGS
import Gargantext.Core.Text.Ngrams (Ngrams(..), NgramsType) import Gargantext.Core.Text.Ngrams (Ngrams(..), NgramsType)
import Gargantext.Database.Admin.Types.Node ( pgNodeId, CorpusId, ListId, DocId ) import Gargantext.Database.Admin.Types.Node ( pgNodeId, CorpusId, ListId, DocId )
import Gargantext.Database.Prelude (runOpaQuery, formatPGSQuery, runPGSQuery, DBCmd) 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.ContextNodeNgrams2
import Gargantext.Database.Query.Table.NodeNgrams (queryNodeNgramsTable) import Gargantext.Database.Query.Table.NodeNgrams (queryNodeNgramsTable)
import Gargantext.Database.Schema.Ngrams import Gargantext.Database.Schema.Ngrams
...@@ -54,6 +54,10 @@ selectNgramsByDoc lIds dId nt = runOpaQuery (query lIds dId nt) ...@@ -54,6 +54,10 @@ selectNgramsByDoc lIds dId nt = runOpaQuery (query lIds dId nt)
on1 (ng, nng, cnng) = (.&&) on1 (ng, nng, cnng) = (.&&)
(ng^.ngrams_id .== nng^.nng_ngrams_id) (ng^.ngrams_id .== nng^.nng_ngrams_id)
(nng^.nng_id .== cnng^.cnng2_nodengrams_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 query lIds' dId' nt' = proc () -> do
(ng,nng,cnng) <- join' -< () (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