Skip to content

Commit fbbc11d

Browse files
use quote in backticks rather than escape (#1111)
Ops Manual PR: neo4j/docs-operations#1959
1 parent 2d3c71b commit fbbc11d

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ MATCH (where {...})
4949
----
5050
MATCH (...)-[where {...}]->()
5151
----
52-
a| The unescaped variable named `where` (or any casing variant, like `WHERE`) used in a node or relationship pattern followed directly by a property key-value expression is deprecated.
53-
To continue using variables with this name, use backticks to escape the variable name:
52+
a| The variable named `where` (or any casing variant, like `WHERE`) used in a node or relationship pattern followed directly by a property key-value expression is deprecated.
53+
To continue using variables with this name, use backticks to quote the variable name:
5454

5555
* Node patterns: `MATCH (++`where`++ { ... })`
5656
* Relationship patterns: `MATCH (...)-[++`where`++ { ... }]->()`
@@ -78,8 +78,8 @@ label:deprecated[]
7878
----
7979
CASE x ... WHEN is :: STRING THEN ... END
8080
----
81-
a| Using an unescaped variable named `is` (or any casing variant, like `IS`) as a `WHEN` operand in a xref:queries/case.adoc#case-simple[simple `CASE`] expression is deprecated.
82-
To continue using variables with this name in simple `CASE` expressions, use backticks to escape the variable name: `CASE x ... WHEN ++`is`++ :: STRING THEN ... END`
81+
a| Using a variable named `is` (or any casing variant, like `IS`) as a `WHEN` operand in a xref:queries/case.adoc#case-simple[simple `CASE`] expression is deprecated.
82+
To continue using variables with this name in simple `CASE` expressions, use backticks to quote the variable name: `CASE x ... WHEN ++`is`++ :: STRING THEN ... END`
8383

8484
a|
8585
label:functionality[]
@@ -91,8 +91,8 @@ CASE x ... WHEN contains + 1 THEN ... END
9191
----
9292
CASE x ... WHEN contains - 1 THEN ... END
9393
----
94-
a| Using an unescaped variable named `contains` (or any casing variant, like `CONTAINS`) in addition or subtraction operations within a `WHEN` operand of a xref:queries/case.adoc#case-simple[simple `CASE`] expression is deprecated.
95-
To continue using variables with this name, use backticks to escape the variable name:
94+
a| Using a variable named `contains` (or any casing variant, like `CONTAINS`) in addition or subtraction operations within a `WHEN` operand of a xref:queries/case.adoc#case-simple[simple `CASE`] expression is deprecated.
95+
To continue using variables with this name, use backticks to quote the variable name:
9696

9797
* Additions: `CASE x ... WHEN ++`contains`++ + 1 THEN ... END`
9898
* Subtractions: `CASE x ... WHEN ++`contains`++ - 1 THEN ... END`
@@ -107,8 +107,8 @@ CASE x ... WHEN in[1] THEN ... END
107107
----
108108
CASE x ... WHEN in["abc"] THEN ... END
109109
----
110-
a| Using the `[]` operator on an unescaped variable named `in` (or any casing variant, like `IN`) within a `WHEN` operand of a xref:queries/case.adoc#case-simple[simple `CASE`] expression is deprecated.
111-
To continue using variables with this name, use backticks to escape the variable name:
110+
a| Using the `[]` operator on a variable named `in` (or any casing variant, like `IN`) within a `WHEN` operand of a xref:queries/case.adoc#case-simple[simple `CASE`] expression is deprecated.
111+
To continue using variables with this name, use backticks to quote the variable name:
112112

113113
* `CASE x ... WHEN ++`in`++[1] THEN ... END`
114114
* `CASE x ... WHEN ++`in`++["abc"] THEN ... END`
@@ -1000,9 +1000,9 @@ label:deprecated[]
10001000
RETURN 1 as my\u0085identifier
10011001
----
10021002
a|
1003-
The Unicode character \`\u0085` is deprecated for unescaped identifiers and will be considered as a whitespace character in the future.
1004-
To continue using it, escape the identifier by adding backticks around the identifier.
1005-
This applies to all unescaped identifiers in Cypher, such as label expressions, properties, variable names or parameters.
1003+
The Unicode character \`\u0085` is deprecated for identifiers not quoted in backticks and will be considered as a whitespace character in the future.
1004+
To continue using it, quote the identifier with backticks.
1005+
This applies to all identifiers in Cypher, such as label expressions, properties, variable names or parameters.
10061006
In the given example, the quoted identifier would be \`my�identifier`.
10071007

10081008
a|
@@ -1013,8 +1013,8 @@ label:deprecated[]
10131013
RETURN 1 as my$Identifier
10141014
----
10151015
a|
1016-
The character with the Unicode representation \`\u0024` is deprecated for unescaped identifiers and will not be supported in the future. To continue using it, escape the identifier by adding backticks around the identifier.
1017-
This applies to all unescaped identifiers in Cypher, such as label expressions, properties, variable names or parameters. In the given example, the quoted identifier would be \`my$identifier`.
1016+
The character with the Unicode representation \`\u0024` is deprecated for identifiers not quoted in backticks and will not be supported in the future. To continue using it, quote the identifier with backticks.
1017+
This applies to all identifiers in Cypher, such as label expressions, properties, variable names or parameters. In the given example, the quoted identifier would be \`my$identifier`.
10181018

10191019
The following Unicode Characters are deprecated in identifiers:
10201020
'\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007',
@@ -2682,7 +2682,7 @@ label:deprecated[]
26822682
CREATE DATABASE databaseName.withDot ...
26832683
----
26842684
a|
2685-
Creating a database with unescaped dots in the name has been deprecated, instead escape the database name:
2685+
Creating a database with dots in the name has been deprecated, instead quote the database name using backticks:
26862686

26872687
[source, cypher, role="noheader"]
26882688
----

modules/ROOT/pages/styleguide.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ RETURN 'Cypher\'s a nice language', "Mats' quote: \"statement\""
472472
RETURN "Cypher's a nice language", 'Mats\' quote: "statement"'
473473
----
474474

475-
* Avoid having to use back-ticks to escape characters and keywords.
475+
* Avoid using characters and keywords that require the input to be quoted with backticks.
476476

477477
.Bad
478478
[source, cypher]

modules/ROOT/pages/syntax/naming.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ For example, `MATCH ( a ) RETURN a` is equivalent to `MATCH (a) RETURN a`.
2525

2626
[[symbolic-names-escaping-rules]]
2727
=== Using special characters in names
28-
Non-alphabetic characters, including numbers, symbols and whitespace characters, *can* be used in names, but *must* be escaped using backticks.
28+
Non-alphabetic characters, including numbers, symbols and whitespace characters, *can* be used in names, but *must* be quoted using backticks.
2929
For example: `++`^n`++`, `++`1first`++`, `++`$$n`++`, and `++`my variable has spaces`++`.
30-
Database names are an exception and may include dots without the need for escaping, although this behavior is deprecated as it may introduce ambiguity when addressing composite databases.
30+
Database names are an exception and may include dots without the need for quoting using backticks, although this behavior is deprecated as it may introduce ambiguity when addressing composite databases.
3131
For example: naming a database `foo.bar.baz` is valid, but deprecated. `++`foo.bar.baz`++` is valid.
3232

33-
Within an escaped name, the following escaping sequences are allowed:
33+
Within a name quoted by backticks, the following character representations are allowed:
3434

3535
[options="header", cols=">1,<2"]
3636
|===
37-
|Escape sequence|Character
37+
| Character representation | Description
3838
|````| Backtick
3939
|`\uxxxx`| Unicode UTF-16 code point (4 hex digits must follow the `\u`)
4040
|===
4141

4242
[NOTE]
4343
====
44-
Using escaped names with unsanitized user input makes you vulnerable to Cypher injection.
44+
Using names quoted in backticks with unsanitized user input makes you vulnerable to Cypher injection.
4545
Some techniques to mitigate this are:
4646
4747
* sanitizing (and validating) the user input.

modules/ROOT/pages/syntax/reserved.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The reserved keywords are not permitted to be used as identifiers in the followi
1616
* Function names
1717
* Parameters
1818

19-
If any reserved keyword is escaped -- i.e. is encapsulated by backticks ```, such as `++`AND`++` -- it would become a valid identifier in the above contexts.
19+
If any reserved keyword is quoted in backticks (```), such as `++`AND`++`, it would become a valid identifier in the above contexts; however, this approach is not recommended.
2020

2121
== Clauses
2222

0 commit comments

Comments
 (0)