You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Mention parameters as the recommended approach
- Change example to use CREATE ALIAS instead of CREATE DATABASE
- Make it clearer which example queries only applies to Cypher 25
As of Cypher 25, database names and aliases cannot include name parts that are quoted individually.
8
8
Either the whole name must be quoted, or the whole name must be unquoted.
9
+
A recommended approach, which is consistent between different commands and Cypher versions, is to send in the database name or alias as a parameter rather than a string literal.
9
10
10
11
== Example scenario
11
-
For example, try to create a database with :
12
+
For example, try to create a database with
12
13
13
14
[source,cypher]
14
15
----
15
-
CREATE DATABASE `foo`.`bar`
16
+
CYPHER 25 CREATE ALIAS `foo`.`bar` FOR DATABASE baz
16
17
----
17
18
18
-
An error will be thrown with GQLSTATUS 42NAA and the status description:
19
+
An error will be thrown with GQLSTATUS 42NAA and the status description
19
20
20
21
[source]
21
22
----
22
23
error: syntax error or access rule violation - incorrectly formatted graph reference. Incorrectly formatted graph reference '`foo`.`bar`'. Expected a single quoted or unquoted identifier. Separate name parts should not be quoted individually.
23
24
----
24
25
25
-
In this example scenario, the correct quoting would either be
26
+
In this example scenario, the preferred way is to send in the alias name as a parameter
27
+
28
+
.Parameters
29
+
[source, parameters]
30
+
----
31
+
{
32
+
"aliasName": "foo.bar"
33
+
}
34
+
----
35
+
36
+
.Query
37
+
[source, cypher]
38
+
----
39
+
CREATE ALIAS $aliasName FOR DATABASE baz
40
+
----
41
+
42
+
Alternatively, if a string literal is used, the correct quoting for Cypher 25 would either be
0 commit comments