Skip to content

Commit e5c832d

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

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
@@ -167,8 +167,8 @@ MATCH (where {...})
167167
----
168168
MATCH (...)-[where {...}]->()
169169
----
170-
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.
171-
To continue using variables with this name, use backticks to escape the variable name:
170+
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.
171+
To continue using variables with this name, use backticks to quote the variable name:
172172

173173
* Node patterns: `MATCH (++`where`++ { ... })`
174174
* Relationship patterns: `MATCH (...)-[++`where`++ { ... }]->()`
@@ -196,8 +196,8 @@ label:deprecated[]
196196
----
197197
CASE x ... WHEN is :: STRING THEN ... END
198198
----
199-
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.
200-
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`
199+
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.
200+
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`
201201

202202
a|
203203
label:functionality[]
@@ -209,8 +209,8 @@ CASE x ... WHEN contains + 1 THEN ... END
209209
----
210210
CASE x ... WHEN contains - 1 THEN ... END
211211
----
212-
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.
213-
To continue using variables with this name, use backticks to escape the variable name:
212+
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.
213+
To continue using variables with this name, use backticks to quote the variable name:
214214

215215
* Additions: `CASE x ... WHEN ++`contains`++ + 1 THEN ... END`
216216
* Subtractions: `CASE x ... WHEN ++`contains`++ - 1 THEN ... END`
@@ -225,8 +225,8 @@ CASE x ... WHEN in[1] THEN ... END
225225
----
226226
CASE x ... WHEN in["abc"] THEN ... END
227227
----
228-
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.
229-
To continue using variables with this name, use backticks to escape the variable name:
228+
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.
229+
To continue using variables with this name, use backticks to quote the variable name:
230230

231231
* `CASE x ... WHEN ++`in`++[1] THEN ... END`
232232
* `CASE x ... WHEN ++`in`++["abc"] THEN ... END`
@@ -1117,9 +1117,9 @@ label:deprecated[]
11171117
RETURN 1 as my\u0085identifier
11181118
----
11191119
a|
1120-
The Unicode character \`\u0085` is deprecated for unescaped identifiers and will be considered as a whitespace character in the future.
1121-
To continue using it, escape the identifier by adding backticks around the identifier.
1122-
This applies to all unescaped identifiers in Cypher, such as label expressions, properties, variable names or parameters.
1120+
The Unicode character \`\u0085` is deprecated for identifiers not quoted in backticks and will be considered as a whitespace character in the future.
1121+
To continue using it, quote the identifier with backticks.
1122+
This applies to all identifiers in Cypher, such as label expressions, properties, variable names or parameters.
11231123
In the given example, the quoted identifier would be \`my�identifier`.
11241124

11251125
a|
@@ -1130,8 +1130,8 @@ label:deprecated[]
11301130
RETURN 1 as my$Identifier
11311131
----
11321132
a|
1133-
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.
1134-
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`.
1133+
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.
1134+
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`.
11351135

11361136
The following Unicode Characters are deprecated in identifiers:
11371137
'\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007',
@@ -2799,7 +2799,7 @@ label:deprecated[]
27992799
CREATE DATABASE databaseName.withDot ...
28002800
----
28012801
a|
2802-
Creating a database with unescaped dots in the name has been deprecated, instead escape the database name:
2802+
Creating a database with dots in the name has been deprecated, instead quote the database name using backticks:
28032803

28042804
[source, cypher, role="noheader"]
28052805
----

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)