Skip to content

Commit ca80cfe

Browse files
Split notifications
1 parent 32ddb86 commit ca80cfe

File tree

2 files changed

+101
-20
lines changed

2 files changed

+101
-20
lines changed

modules/ROOT/pages/changelogs.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
[source, status codes, role="noheader"]
99
-----
10-
Neo.ClientNotification.Statement.SuperfluousOptional
10+
Neo.ClientNotification.Statement.RedundantOptionalProcedure
11+
Neo.ClientNotification.Statement.RedundantOptionalSubquery
1112
-----
1213

1314
== Neo4j 5.23

modules/ROOT/pages/notifications/all-notifications.adoc

Lines changed: 99 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3544,29 +3544,109 @@ RETURN *
35443544
======
35453545
=====
35463546

3547-
[#_neo_clientnotification_statement_superfluousoptional]
3548-
=== Superfluous Optional
3547+
[#_neo_clientnotification_statement_redundantoptionalprocedure]
3548+
=== Redundant Optional Procedure
35493549

3550-
.Notification details
3550+
.notification details
35513551
[cols="<1s,<4"]
35523552
|===
3553-
|Neo4j code
3554-
m|Neo.ClientNotification.Statement.SuperfluousOptional
3555-
|Title
3556-
a|The use of OPTIONAL is superfluous when `CALL` is a unit subquery or a void procedure.
3557-
|Description
3558-
|The use of OPTIONAL is superfluous when `CALL` is a unit subquery or a void procedure.
3559-
|Category
3560-
m|GENERIC
3561-
|GQLSTATUS code
3562-
m|03N61
3563-
|Status description
3564-
a|info: superfluous optional. The use of optional is superfluous when `CALL` is a unit subquery or a void procedure.
3565-
|Classification
3566-
m|GENERIC
3567-
|SeverityLevel
3568-
m|INFORMATION
3553+
|neo4j code
3554+
m|neo.clientnotification.statement.redundantoptionalprocedure
3555+
|title
3556+
a|The use of `OPTIONAL` is redundant when the procedure calls a void procedure.
3557+
|description
3558+
|The use of `OPTIONAL` is redundant as `CALL %s` is a void procedure.
3559+
|category
3560+
m|generic
3561+
|gqlstatus code
3562+
m|03n61
3563+
|status description
3564+
a|info: redundant optional procedure. The use of `OPTIONAL` is redundant as `CALL %s` is a void procedure.
3565+
|classification
3566+
m|generic
3567+
|severitylevel
3568+
m|information
3569+
|===
3570+
3571+
.Redundant use of optional on a procedure call.
3572+
[.tabbed-example]
3573+
=====
3574+
[.include-with-neo4j-code]
3575+
======
3576+
Query::
3577+
+
3578+
[source,cypher]
3579+
----
3580+
OPTIONAL CALL db.createLabel("A")
3581+
----
3582+
3583+
Description of the returned code::
3584+
Optional is redundant in the case of void procedures. The use of `OPTIONAL` on void procedures have no effect and can be removed.
3585+
3586+
Suggestions for improvement::
3587+
If the intended behavior of the query is to use a void procedure the `OPTIONAL` keyword can be removed without impacting the query.
3588+
+
3589+
[source,cypher]
3590+
----
3591+
CALL db.createLabel("A")
3592+
----
3593+
======
3594+
=====
3595+
3596+
[#_neo_clientnotification_statement_redundantoptionalsubquery]
3597+
=== Redundant Optional Subquery
3598+
3599+
.notification details
3600+
[cols="<1s,<4"]
35693601
|===
3602+
|neo4j code
3603+
m|neo.clientnotification.statement.redundantoptionalsubquery
3604+
|title
3605+
a|The use of `OPTIONAL` is redundant when `CALL` is a unit subquery.
3606+
|description
3607+
|The use of `OPTIONAL` is redundant as `CALL` is a unit subquery.
3608+
|category
3609+
m|generic
3610+
|gqlstatus code
3611+
m|03n62
3612+
|status description
3613+
a|info: redundant optional subquery. The use of `OPTIONAL` is redundant as `CALL` is a unit subquery.
3614+
|classification
3615+
m|generic
3616+
|severitylevel
3617+
m|information
3618+
|===
3619+
3620+
.Redundant use of optional on a call subquery.
3621+
[.tabbed-example]
3622+
=====
3623+
[.include-with-neo4j-code]
3624+
======
3625+
Query::
3626+
+
3627+
[source,cypher]
3628+
----
3629+
UNWIND [1, 2, 3] AS x
3630+
OPTIONAL CALL (x) {
3631+
CREATE({i:x})
3632+
}
3633+
----
3634+
3635+
Description of the returned code::
3636+
Optional is redundant in the case of a unit subquery. The use of `OPTIONAL` on unit subqueries have no effect and can be removed.
3637+
3638+
Suggestions for improvement::
3639+
If the intended behavior of the query is for the subquery not to return any values the `OPTIONAL` keyword can be removed without impacting the query.
3640+
+
3641+
[source,cypher]
3642+
----
3643+
UNWIND [1, 2, 3] AS x
3644+
CALL (x) {
3645+
CREATE({i:x})
3646+
}
3647+
----
3648+
======
3649+
=====
35703650

35713651
[#_neo_clientnotification_statement_parameternotprovided]
35723652
=== Parameter missing

0 commit comments

Comments
 (0)