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
195
Issues
195
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
8ccfb5c6
Verified
Commit
8ccfb5c6
authored
Feb 10, 2023
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[opaleye] remove ReadNull type instances
They are changed to MaybeFields ...Read instead when joining.
parent
a19f6924
Pipeline
#3658
failed with stage
in 48 minutes and 14 seconds
Changes
19
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
2 additions
and
230 deletions
+2
-230
Similarities.hs
src/Gargantext/Core/Methods/Similarities.hs
+0
-1
Search.hs
src/Gargantext/Database/Action/Search.hs
+0
-53
Share.hs
src/Gargantext/Database/Action/Share.hs
+0
-14
Facet.hs
src/Gargantext/Database/Query/Facet.hs
+1
-19
Types.hs
src/Gargantext/Database/Query/Facet/Types.hs
+0
-19
Select.hs
src/Gargantext/Database/Query/Table/Node/Select.hs
+0
-7
Context.hs
src/Gargantext/Database/Schema/Context.hs
+0
-21
ContextNodeNgrams.hs
src/Gargantext/Database/Schema/ContextNodeNgrams.hs
+0
-8
ContextNodeNgrams2.hs
src/Gargantext/Database/Schema/ContextNodeNgrams2.hs
+0
-5
Ngrams.hs
src/Gargantext/Database/Schema/Ngrams.hs
+0
-4
NgramsPostag.hs
src/Gargantext/Database/Schema/NgramsPostag.hs
+0
-8
Node.hs
src/Gargantext/Database/Schema/Node.hs
+0
-20
NodeContext.hs
src/Gargantext/Database/Schema/NodeContext.hs
+0
-6
NodeContext_NodeContext.hs
src/Gargantext/Database/Schema/NodeContext_NodeContext.hs
+1
-7
NodeNgrams.hs
src/Gargantext/Database/Schema/NodeNgrams.hs
+0
-11
NodeNode.hs
src/Gargantext/Database/Schema/NodeNode.hs
+0
-5
NodeNodeNgrams.hs
src/Gargantext/Database/Schema/NodeNodeNgrams.hs
+0
-8
NodeNodeNgrams2.hs
src/Gargantext/Database/Schema/NodeNodeNgrams2.hs
+0
-6
User.hs
src/Gargantext/Database/Schema/User.hs
+0
-8
No files found.
src/Gargantext/Core/Methods/Similarities.hs
View file @
8ccfb5c6
...
...
@@ -51,4 +51,3 @@ instance Arbitrary GraphMetric where
arbitrary
=
elements
[
minBound
..
maxBound
]
------------------------------------------------------------------------
src/Gargantext/Database/Action/Search.hs
View file @
8ccfb5c6
...
...
@@ -27,7 +27,6 @@ import Gargantext.Database.Admin.Types.Hyperdata (HyperdataDocument(..), Hyperda
import
Gargantext.Database.Prelude
(
Cmd
,
runOpaQuery
,
runCountOpaQuery
)
import
Gargantext.Database.Query.Facet
import
Gargantext.Database.Query.Filter
import
Gargantext.Database.Query.Join
(
leftJoin5
)
import
Gargantext.Database.Query.Table.Node
import
Gargantext.Database.Query.Table.Context
import
Gargantext.Database.Query.Table.ContextNodeNgrams
(
queryContextNodeNgramsTable
)
...
...
@@ -251,55 +250,3 @@ queryContactViaDoc = proc () -> do
\
doc'
->
justFields
(
doc'
^.
cs_id
)
.===
(
view
nc_context_id
<$>
corpus
)
returnA
-<
(
contact
,
annuaire
,
nodeContext_nodeContext
,
corpus
,
doc
)
queryContactViaDoc'
::
O
.
Select
(
ContextSearchRead
,
(
NodeContextReadNull
,
(
NodeContext_NodeContextReadNull
,
(
NodeContextReadNull
,
ContextReadNull
)
)
)
)
queryContactViaDoc'
=
leftJoin5
queryContextTable
queryNodeContextTable
queryNodeContext_NodeContextTable
queryNodeContextTable
queryContextSearchTable
cond12
cond23
cond34
cond45
where
cond12
::
(
NodeContextRead
,
ContextRead
)
->
Column
SqlBool
cond12
(
annuaire
,
contact
)
=
contact
^.
context_id
.==
annuaire
^.
nc_context_id
cond23
::
(
NodeContext_NodeContextRead
,
(
NodeContextRead
,
ContextReadNull
)
)
->
Column
SqlBool
cond23
(
nodeContext_nodeContext
,
(
annuaire
,
_
))
=
nodeContext_nodeContext
^.
ncnc_nodecontext2
.==
annuaire
^.
nc_id
cond34
::
(
NodeContextRead
,
(
NodeContext_NodeContextRead
,
(
NodeContextReadNull
,
ContextReadNull
)
)
)
->
Column
SqlBool
cond34
(
corpus
,
(
nodeContext_nodeContext
,
(
_
,
_
)))
=
nodeContext_nodeContext
^.
ncnc_nodecontext1
.==
corpus
^.
nc_id
cond45
::
(
ContextSearchRead
,
(
NodeContextRead
,
(
NodeContext_NodeContextReadNull
,
(
NodeContextReadNull
,
ContextReadNull
)
)
)
)
->
Column
SqlBool
cond45
(
doc
,
(
corpus
,
(
_
,(
_
,
_
))))
=
doc
^.
cs_id
.==
corpus
^.
nc_context_id
src/Gargantext/Database/Action/Share.hs
View file @
8ccfb5c6
...
...
@@ -88,20 +88,6 @@ nodeNode_node_User = proc () -> do
returnA
-<
(
nn
,
n
,
u
)
-- nodeNode_node_User' :: O.Select (NodeNodeRead, (NodeReadNull, UserReadNull))
-- nodeNode_node_User' = leftJoin3' queryNodeNodeTable
-- queryNodeTable
-- queryUserTable
-- cond12
-- cond23
-- where
-- cond12 :: (NodeNodeRead, (NodeRead, UserReadNull)) -> Column SqlBool
-- cond12 (nn, (n, _u)) = (nn^.nn_node1_id .== n^.node_id)
-- cond23 :: (NodeRead, UserRead) -> Column SqlBool
-- cond23 (n, u) = (n^.node_user_id .== user_id u)
------------------------------------------------------------------------
-- To Share a Node Team with a user, use this function
-- basically used with the invitation to a team
...
...
src/Gargantext/Database/Query/Facet.hs
View file @
8ccfb5c6
...
...
@@ -32,13 +32,11 @@ module Gargantext.Database.Query.Facet
,
FacetDocRead
,
FacetPaired
(
..
)
,
FacetPairedRead
,
FacetPairedReadNull
,
FacetPairedReadNullAgg
,
OrderBy
(
..
)
)
where
import
Control.Arrow
(
returnA
,
(
>>>
)
)
import
Control.Arrow
(
returnA
)
import
Control.Lens
((
^.
))
import
qualified
Data.Text
as
T
import
Opaleye
...
...
@@ -95,8 +93,6 @@ viewAuthorsDoc cId _ nt = proc () -> do
,
facetDoc_ngramCount
=
toNullable
$
sqlDouble
1.0
,
facetDoc_score
=
toNullable
$
sqlDouble
1
}
--queryAuthorsDoc :: Select (NodeRead, (ContextNodeNgramsReadNull, (NgramsReadNull, (ContextNodeNgramsRead, NodeReadNull))))
--queryAuthorsDoc = leftJoin5 queryNodeTable queryContextNodeNgramsTable queryNgramsTable queryContextNodeNgramsTable queryNodeTable cond12 cond23 cond34 cond45
queryAuthorsDoc
::
Select
(
NodeRead
,
MaybeFields
ContextNodeNgramsRead
,
MaybeFields
NgramsRead
...
...
@@ -114,20 +110,6 @@ queryAuthorsDoc = proc () -> do
\
contact'
->
justFields
(
_node_id
contact'
)
.===
(
_cnng_context_id
<$>
cnn2
)
returnA
-<
(
n
,
cnn
,
ng
,
cnn2
,
contact
)
-- where
-- cond12 :: (ContextNodeNgramsRead, NodeRead) -> Field SqlBool
-- cond12 (nodeNgram, doc) = _node_id doc
-- .== _cnng_context_id nodeNgram
-- cond23 :: (NgramsRead, (ContextNodeNgramsRead, NodeReadNull)) -> Field SqlBool
-- cond23 (ngrams', (nodeNgram, _)) = ngrams'^.ngrams_id
-- .== _cnng_ngrams_id nodeNgram
-- cond34 :: (ContextNodeNgramsRead, (NgramsRead, (ContextNodeNgramsReadNull, NodeReadNull))) -> Field SqlBool
-- cond34 (nodeNgram2, (ngrams', (_,_)))= ngrams'^.ngrams_id .== _cnng_ngrams_id nodeNgram2
-- cond45 :: (NodeRead, (ContextNodeNgramsRead, (NgramsReadNull, (ContextNodeNgramsReadNull, NodeReadNull)))) -> Field SqlBool
-- cond45 (contact', (nodeNgram2', (_, (_,_)))) = _node_id contact' .== _cnng_context_id nodeNgram2'
------------------------------------------------------------------------
...
...
src/Gargantext/Database/Query/Facet/Types.hs
View file @
8ccfb5c6
...
...
@@ -102,25 +102,6 @@ type FacetPairedRead = FacetPaired (Field SqlInt4 )
(
Field
SqlJsonb
)
(
Field
SqlInt4
)
type
FacetPairedReadNull
=
FacetPaired
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlTimestamptz
)
(
FieldNullable
SqlJsonb
)
(
FieldNullable
SqlInt4
)
type
FacetPairedReadNullAgg
=
FacetPaired
(
Aggregator
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
)
(
Aggregator
(
FieldNullable
SqlTimestamptz
)
(
FieldNullable
SqlTimestamptz
)
)
(
Aggregator
(
FieldNullable
SqlJsonb
)
(
FieldNullable
SqlJsonb
)
)
(
Aggregator
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
)
...
...
src/Gargantext/Database/Query/Table/Node/Select.hs
View file @
8ccfb5c6
...
...
@@ -37,10 +37,3 @@ selectNodesWithUsername nt u = runOpaQuery $ proc () -> do
Just
us
->
user_username
us
.==
sqlStrictText
u
restrict
-<
_node_typename
n
.==
sqlInt4
(
toDBid
nt
)
returnA
-<
_node_id
n
-- join' :: Select (NodeRead, UserReadNull)
-- --join' = leftJoin queryNodeTable queryUserTable on1
-- join' = optionalRestrict queryUserTable -<
-- (\(n, us) -> _node_user_id n .== user_id ud)
-- -- where
-- -- on1 (n,us) = _node_user_id n .== user_id us
src/Gargantext/Database/Schema/Context.hs
View file @
8ccfb5c6
...
...
@@ -89,15 +89,6 @@ type ContextRead = ContextPoly (Field SqlInt4 )
(
Field
SqlText
)
(
Field
SqlTimestamptz
)
(
Field
SqlJsonb
)
type
ContextReadNull
=
ContextPoly
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlText
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlText
)
(
FieldNullable
SqlTimestamptz
)
(
FieldNullable
SqlJsonb
)
------------------------------------------------------------------------
-- | Context(Read|Write)Search is slower than Context(Write|Read) use it
-- for full text search only
...
...
@@ -124,18 +115,6 @@ type ContextSearchRead =
(
Field
SqlJsonb
)
(
Field
SqlTSVector
)
type
ContextSearchReadNull
=
ContextPolySearch
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlText
)
(
FieldNullable
SqlTimestamptz
)
(
FieldNullable
SqlJsonb
)
(
FieldNullable
SqlTSVector
)
data
ContextPolySearch
id
typename
user_id
...
...
src/Gargantext/Database/Schema/ContextNodeNgrams.hs
View file @
8ccfb5c6
...
...
@@ -55,14 +55,6 @@ type ContextNodeNgramsRead =
(
Field
SqlFloat8
)
(
Field
SqlInt4
)
type
ContextNodeNgramsReadNull
=
ContextNodeNgramsPoly
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlFloat8
)
(
FieldNullable
SqlInt4
)
$
(
makeAdaptorAndInstance
"pContextNodeNgrams"
''
C
ontextNodeNgramsPoly
)
makeLenses
''
C
ontextNodeNgramsPoly
...
...
src/Gargantext/Database/Schema/ContextNodeNgrams2.hs
View file @
8ccfb5c6
...
...
@@ -43,11 +43,6 @@ type ContextNodeNgrams2Read =
(
Column
SqlInt4
)
(
Column
SqlFloat8
)
type
ContextNodeNgrams2ReadNull
=
ContextNodeNgrams2Poly
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlFloat8
))
$
(
makeAdaptorAndInstance
"pContextNodeNgrams2"
''
C
ontextNodeNgrams2Poly
)
makeLenses
''
C
ontextNodeNgrams2Poly
...
...
src/Gargantext/Database/Schema/Ngrams.hs
View file @
8ccfb5c6
...
...
@@ -60,10 +60,6 @@ type NgramsRead = NgramsPoly (Field SqlInt4)
(
Field
SqlText
)
(
Field
SqlInt4
)
type
NgramsReadNull
=
NgramsPoly
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlText
)
(
FieldNullable
SqlInt4
)
type
NgramsDB
=
NgramsPoly
Int
Text
Int
$
(
makeAdaptorAndInstance
"pNgramsDb"
''
N
gramsPoly
)
...
...
src/Gargantext/Database/Schema/NgramsPostag.hs
View file @
8ccfb5c6
...
...
@@ -67,14 +67,6 @@ type NgramsPosTagRead = NgramsPostagPoly (Column SqlInt4)
(
Column
SqlInt4
)
(
Column
SqlInt4
)
(
Column
SqlInt4
)
type
NgramsPosTagReadNull
=
NgramsPostagPoly
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlText
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
makeLenses
''
N
gramsPostagPoly
instance
PGS
.
ToRow
NgramsPostagDB
where
...
...
src/Gargantext/Database/Schema/Node.hs
View file @
8ccfb5c6
...
...
@@ -89,15 +89,6 @@ type NodeRead = NodePoly (Field SqlInt4 )
(
Field
SqlText
)
(
Field
SqlTimestamptz
)
(
Field
SqlJsonb
)
type
NodeReadNull
=
NodePoly
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlText
)
(
Field
SqlInt4
)
(
Field
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
Field
SqlText
)
(
FieldNullable
SqlTimestamptz
)
(
Field
SqlJsonb
)
------------------------------------------------------------------------
-- | Node(Read|Write)Search is slower than Node(Write|Read) use it
-- for full text search only
...
...
@@ -124,17 +115,6 @@ type NodeSearchRead =
(
Field
SqlJsonb
)
(
Field
SqlTSVector
)
type
NodeSearchReadNull
=
NodePolySearch
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlText
)
(
FieldNullable
SqlTimestamptz
)
(
FieldNullable
SqlJsonb
)
(
FieldNullable
SqlTSVector
)
data
NodePolySearch
id
typename
...
...
src/Gargantext/Database/Schema/NodeContext.hs
View file @
8ccfb5c6
...
...
@@ -46,12 +46,6 @@ type NodeContextRead = NodeContextPoly (Field SqlInt4)
(
Field
SqlFloat8
)
(
Field
SqlInt4
)
type
NodeContextReadNull
=
NodeContextPoly
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlInt4
)
(
FieldNullable
SqlFloat8
)
(
FieldNullable
SqlInt4
)
type
NodeContext
=
NodeContextPoly
(
Maybe
Int
)
NodeId
NodeId
(
Maybe
Double
)
(
Maybe
Int
)
$
(
makeAdaptorAndInstance
"pNodeContext"
''
N
odeContextPoly
)
...
...
src/Gargantext/Database/Schema/NodeContext_NodeContext.hs
View file @
8ccfb5c6
{-|
Module : Gargantext.Database.Schema.ContextContext
Description :
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
...
...
@@ -35,9 +35,6 @@ type NodeContext_NodeContextWrite = NodeContext_NodeContextPoly (Column (SqlInt4
type
NodeContext_NodeContextRead
=
NodeContext_NodeContextPoly
(
Column
(
SqlInt4
))
(
Column
(
SqlInt4
))
type
NodeContext_NodeContextReadNull
=
NodeContext_NodeContextPoly
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
type
NodeContext_NodeContext
=
NodeContext_NodeContextPoly
NodeContextId
NodeContextId
$
(
makeAdaptorAndInstance
"pNodeContext_NodeContext"
''
N
odeContext_NodeContextPoly
)
...
...
@@ -53,6 +50,3 @@ nodeContext_NodeContextTable =
)
queryNodeContext_NodeContextTable
::
Query
NodeContext_NodeContextRead
queryNodeContext_NodeContextTable
=
selectTable
nodeContext_NodeContextTable
src/Gargantext/Database/Schema/NodeNgrams.hs
View file @
8ccfb5c6
...
...
@@ -68,17 +68,6 @@ type NodeNgramsRead = NodeNgramsPoly (Column SqlInt4)
(
Column
SqlInt4
)
(
Column
SqlFloat8
)
type
NodeNgramsReadNull
=
NodeNgramsPoly
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlFloat8
))
type
NodeNgramsId
=
Int
type
NgramsField
=
Int
type
NgramsTag
=
Int
...
...
src/Gargantext/Database/Schema/NodeNode.hs
View file @
8ccfb5c6
...
...
@@ -40,11 +40,6 @@ type NodeNodeRead = NodeNodePoly (Field SqlInt4)
(
Field
SqlFloat8
)
(
Field
SqlInt4
)
type
NodeNodeReadNull
=
NodeNodePoly
(
Field
SqlInt4
)
(
Field
SqlInt4
)
(
FieldNullable
SqlFloat8
)
(
FieldNullable
SqlInt4
)
type
NodeNode
=
NodeNodePoly
NodeId
NodeId
(
Maybe
Double
)
(
Maybe
Int
)
$
(
makeAdaptorAndInstance
"pNodeNode"
''
N
odeNodePoly
)
...
...
src/Gargantext/Database/Schema/NodeNodeNgrams.hs
View file @
8ccfb5c6
...
...
@@ -45,13 +45,6 @@ type NodeNodeNgramsRead =
(
Column
SqlInt4
)
(
Column
SqlFloat8
)
type
NodeNodeNgramsReadNull
=
NodeNodeNgramsPoly
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlFloat8
))
type
NodeNodeNgrams
=
NodeNodeNgramsPoly
CorpusId
DocId
NgramsId
NgramsTypeId
Double
...
...
@@ -69,4 +62,3 @@ nodeNodeNgramsTable = Table "node_node_ngrams"
,
_nnng_weight
=
requiredTableField
"weight"
}
)
src/Gargantext/Database/Schema/NodeNodeNgrams2.hs
View file @
8ccfb5c6
...
...
@@ -39,11 +39,6 @@ type NodeNodeNgrams2Read =
(
Column
SqlInt4
)
(
Column
SqlFloat8
)
type
NodeNodeNgrams2ReadNull
=
NodeNodeNgrams2Poly
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlInt4
))
(
Column
(
Nullable
SqlFloat8
))
type
NodeNodeNgrams2
=
NodeNodeNgrams2Poly
DocId
NodeNgramsId
Double
...
...
@@ -58,4 +53,3 @@ nodeNodeNgrams2Table = Table "node_node_ngrams2"
,
_nnng2_weight
=
requiredTableField
"weight"
}
)
src/Gargantext/Database/Schema/User.hs
View file @
8ccfb5c6
...
...
@@ -99,14 +99,6 @@ type UserRead = UserPoly (Column SqlInt4) (Column SqlText)
(
Column
SqlTimestamptz
)
(
Column
SqlText
)
type
UserReadNull
=
UserPoly
(
Column
(
Nullable
SqlInt4
))
(
Column
SqlText
)
(
Column
(
Nullable
SqlTimestamptz
))
(
Column
SqlBool
)
(
Column
SqlText
)
(
Column
SqlText
)
(
Column
SqlText
)
(
Column
SqlText
)
(
Column
SqlBool
)
(
Column
SqlBool
)
(
Column
(
Nullable
SqlTimestamptz
))
(
Column
(
Nullable
SqlText
))
type
UserDB
=
UserPoly
Int
Text
(
Maybe
UTCTime
)
Bool
Text
Text
Text
Text
Bool
Bool
UTCTime
(
Maybe
Text
)
$
(
makeAdaptorAndInstance
"pUserDB"
''
U
serPoly
)
...
...
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