Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Q
query-conversion
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GraphPolaris
query-conversion
Commits
9a17cad5
Commit
9a17cad5
authored
1 year ago
by
Leonardo Christino
Browse files
Options
Downloads
Patches
Plain Diff
fix: correctly filter relationship list
parent
7ab3a098
No related branches found
No related tags found
No related merge requests found
Pipeline
#127999
failed
1 year ago
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cypherv2/convertQuery.go
+3
-5
3 additions, 5 deletions
cypherv2/convertQuery.go
cypherv2/convertQuery_test.go
+71
-1417
71 additions, 1417 deletions
cypherv2/convertQuery_test.go
with
74 additions
and
1422 deletions
cypherv2/convertQuery.go
+
3
−
5
View file @
9a17cad5
...
...
@@ -346,11 +346,9 @@ func formQuery(JSONQuery *entityv2.IncomingQueryJSON) (*string, error) {
for
_
,
relation
:=
range
cacheData
.
relations
{
// if we need to do logic on relations, this with is required
withLine
:=
fmt
.
Sprintf
(
"WITH *, relationships(%s) AS %s_rel
\n
"
,
relation
.
queryId
,
relation
.
queryId
)
if
relation
.
queryId
!=
""
&&
strings
.
Contains
(
logic
,
relation
.
id
)
&&
!
strings
.
Contains
(
totalQuery
,
withLine
)
{
totalQuery
+=
withLine
logic
=
fmt
.
Sprintf
(
"ALL(%s_rel_%s in %s_rel WHERE %s)"
,
relation
.
queryId
,
relation
.
id
,
relation
.
queryId
,
if
relation
.
queryId
!=
""
&&
strings
.
Contains
(
logic
,
relation
.
id
)
{
logic
=
fmt
.
Sprintf
(
"ALL(%s_rel_%s in %s WHERE %s)"
,
relation
.
queryId
,
relation
.
id
,
relation
.
id
,
strings
.
ReplaceAll
(
logic
,
relation
.
id
,
fmt
.
Sprintf
(
"%s_rel_%s"
,
relation
.
queryId
,
relation
.
id
)))
}
}
...
...
This diff is collapsed.
Click to expand it.
cypherv2/convertQuery_test.go
+
71
−
1417
View file @
9a17cad5
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment