Skip to content

Commit b288df4

Browse files
Apply suggestions from code review
Co-authored-by: Reneta Popova <[email protected]>
1 parent 9e6c3f7 commit b288df4

File tree

3 files changed

+42
-21
lines changed

3 files changed

+42
-21
lines changed

modules/ROOT/pages/database-administration/aliases/manage-aliases-composite-databases.adoc

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,12 @@ However, when it comes to escaping names using backticks, there are some additio
222222
Dots in alias names are ambiguous.
223223
They could either be interpreted as part of the name itself, or as the dot that separates a composite namespace from the alias name.
224224

225+
[role=label--new-2025.06]
225226
=== Conflicting names
226-
Before Neo4j 2025.06, it was possible to create conflicting aliases such as the constituent alias `flowers` within the composite database `garden` as well as the non-composite local alias `garden.flowers`.
227-
Both of these would be referred to by the same name `garden.flowers`.
227+
In versions earlier than Neo4j 2025.06, it is possible to create conflicting aliases, such as the constituent alias `flowers` within the composite database `garden` as well as the non-composite local alias `garden.flowers`.
228+
Both of these are referred to by the same name, `garden.flowers`.
228229

229-
Neo4j 2025.06 and later versions ensure that no such conflicts exist and will throw an exception when attempting to create a new alias with the same name as an existing alias.
230+
Neo4j 2025.06 and later versions ensure that no such conflicts exist and throw an exception when attempting to create a new alias with the same name as an existing alias.
230231

231232
[.tabbed-example]
232233
=====
@@ -254,7 +255,7 @@ Failed to create the specified database alias 'garden.flowers': Database name or
254255
======
255256

256257
Creating a regular alias with the same name as an existing composite constituent is disallowed.
257-
In Cypher 25 it is clear that the two names are considered the same, since the parts are not quoted separately as they would be in Cypher 5.
258+
In Cypher 25, the two names are considered the same since the parts are not quoted separately as they would be in Cypher 5.
258259

259260
.Query
260261
[source, cypher]
@@ -276,7 +277,8 @@ Failed to create the specified database alias 'garden.flowers': Database name or
276277
=====
277278
[role=include-with-cypher-5]
278279
======
279-
Creating a composite constituent with the same name as an existing non-composite alias is disallowed. This example scenario is prevented already on the second line, thus the constituent on the third line cannot be created.
280+
Creating a composite constituent with the same name as an existing non-composite alias is disallowed.
281+
This example scenario is already prevented on the second line; thus, the constituent on the third line cannot be created.
280282

281283
.Query
282284
[source, cypher]
@@ -298,7 +300,7 @@ Cannot create database 'garden' because another database 'garden.flowers' exists
298300
======
299301

300302
Creating a composite constituent with the same name as an existing non-composite alias is disallowed.
301-
This example scenario is prevented already on the second line, thus the constituent on the third line cannot be created.
303+
This example scenario is already prevented on the second line; thus, the constituent on the third line cannot be created.
302304
The Cypher 25 syntax makes no distinction between the names to clarify that they are considered equivalent.
303305

304306
.Query
@@ -318,14 +320,13 @@ Cannot create database 'garden' because another database 'garden.flowers' exists
318320
=====
319321

320322

321-
Creating a composite constituent with the same name as an existing non-composite alias is disallowed:
322323

323324
=== Cypher 25 specific behaviour
324325
==== Accessing an existing alias with dots
325326

326327
Cypher 25 relies on the guarantee that no conflicting names are allowed in Neo4j 2025.06 and later.
327-
The following queries all act on the same alias, regardless if that alias is a composite constituent or not.
328-
The special quoting of separate name parts that was necessary in Cypher 5 is not permitted in Cypher 25.
328+
The following queries all act on the same alias, regardless of whether that alias is a composite constituent or not.
329+
The special quoting of separate name parts that is necessary in Cypher 5 is not permitted in Cypher 25.
329330

330331
.Parameters
331332
[source, javascript]
@@ -343,23 +344,33 @@ CYPHER 25 USE `my.garden.beautiful.flowers` RETURN 1
343344
----
344345

345346
==== Creating a new alias with dots
346-
During `CREATE`, Cypher 25 will split the given name on each dot, left to right, and check if a corresponding composite database exists.
347-
If no composite database is found, Cypher25 will fall back to creating a regular non-composite alias instead.
348347

349-
The following query attempts to create in order:
348+
During `CREATE`, Cypher 25 splits the given name on each dot, left to right, and checks if a corresponding composite database exists.
349+
If no composite database is found, Cypher25 falls back to creating a regular non-composite alias.
350350

351-
* Constituent alias `garden.beautiful.flowers` within composite database `my`.
352-
* Constituent alias `beautiful.flowers` within composite database `my.garden`.
353-
* Constituent alias `flowers` within composite database `my.garden.beautiul`.
354-
* Regular non-composite alias `my.garden.beautiful.flowers`.
351+
For example:
355352

356353
.Query
357354
[source, cypher]
358355
----
359356
CYPHER 25 CREATE COMPOSITE DATABASE `my.garden`
360357
CYPHER 25 CREATE ALIAS `my.garden.beautiful.flowers` FOR DATABASE `northwind-graph`
361358
----
362-
Since it finds the composite database `my.garden` it will create the constituent alias `beautiful.flowers` within the found composite.
359+
360+
The query attempts to create the following aliases in the given order:
361+
362+
. Constituent alias `garden.beautiful.flowers` within composite database `my`.
363+
. Constituent alias `beautiful.flowers` within composite database `my.garden`.
364+
. Constituent alias `flowers` within composite database `my.garden.beautiful`.
365+
. Regular non-composite alias `my.garden.beautiful.flowers`.
366+
367+
.Query
368+
[source, cypher]
369+
----
370+
CYPHER 25 CREATE COMPOSITE DATABASE `my.garden`
371+
CYPHER 25 CREATE ALIAS `my.garden.beautiful.flowers` FOR DATABASE `northwind-graph`
372+
----
373+
When it finds the composite database `my.garden`, it creates the constituent alias `beautiful.flowers` within that composite.
363374

364375

365376

@@ -369,7 +380,11 @@ Since it finds the composite database `my.garden` it will create the constituent
369380

370381
The composite database name and the database alias name need to be quoted individually.
371382
Backticks may be added regardless of whether the name contains special characters or not, so it is good practice to always backtick both names, e.g. `++`composite`++.++`alias`++`.
372-
Note however that separating composite database name and alias name with backticks is no longer supported in Cypher 25.
383+
[NOTE]
384+
====
385+
Separating composite database name and alias name with backticks is no longer supported in Cypher 25.
386+
See <<_cypher_25_specific_behaviour, Cypher 25 specific behaviour>> for details.
387+
====
373388

374389
The following example creates a database alias named `my alias with spaces` as a constituent in the composite database named `my-composite-database-with-dashes`:
375390

@@ -415,7 +430,8 @@ CYPHER 5 CREATE ALIAS `my.composite.database.with.dots`.`my.other.alias.with.dot
415430

416431
==== Single dots and local database aliases
417432
[NOTE]
418-
This used to be deprecated, but the deprecation has since been revoked.
433+
====
434+
As of Neo4j 2025.06, this feature is no longer deprecated.
419435
420436
There is a special case for local database aliases with a single dot without any existing composite database.
421437
If a composite database `some` exists, the query below will create a database alias named `alias` within the composite database `some`.

modules/ROOT/pages/database-administration/aliases/naming-aliases.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ The following naming rules apply:
1212
* Names cannot end with dots.
1313
* Names that begin with an underscore or with the prefix `system` are reserved for internal use.
1414
* Non-alphabetic characters, including numbers, symbols, dots, and whitespace characters, can be used in names, but must be quoted using backticks.
15-
* Dots (`.`) are interpreted as a delimiter between composite database and constituent alias name if a matching composite database exists.
16-
Otherwise, Neo4j will fall back to interpreting the dot as simply part of the database name.
15+
* Dots (`.`) are interpreted as a delimiter between a composite database and a constituent alias name if a matching composite database exists.
16+
Otherwise, Neo4j interprets the dot as simply part of the database name.
1717
1818
The name restrictions and escaping rules apply to all the different database alias commands.
1919

modules/ROOT/pages/database-administration/composite-databases/querying-composite-databases.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ CREATE ALIAS `cineasts`.`upcoming`
4646
USER neo4j
4747
PASSWORD 'password'
4848
----
49+
[NOTE]
50+
====
51+
Cypher 5 is the version that is in use in Neo4j up to and including version 2025.05.
52+
For details, see xref:introduction.adoc#_cypher_versions[Cypher® versions].
53+
====
4954
=====
5055
[role=include-with-cypher-25 label--new-2025.06]
5156
=====

0 commit comments

Comments
 (0)