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
Copy file name to clipboardExpand all lines: modules/ROOT/pages/database-administration/aliases/manage-aliases-composite-databases.adoc
+35-19Lines changed: 35 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -222,11 +222,12 @@ However, when it comes to escaping names using backticks, there are some additio
222
222
Dots in alias names are ambiguous.
223
223
They could either be interpreted as part of the name itself, or as the dot that separates a composite namespace from the alias name.
224
224
225
+
[role=label--new-2025.06]
225
226
=== 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`.
228
229
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.
230
231
231
232
[.tabbed-example]
232
233
=====
@@ -254,7 +255,7 @@ Failed to create the specified database alias 'garden.flowers': Database name or
254
255
======
255
256
256
257
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.
258
259
259
260
.Query
260
261
[source, cypher]
@@ -276,7 +277,8 @@ Failed to create the specified database alias 'garden.flowers': Database name or
276
277
=====
277
278
[role=include-with-cypher-5]
278
279
======
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.
280
282
281
283
.Query
282
284
[source, cypher]
@@ -298,7 +300,7 @@ Cannot create database 'garden' because another database 'garden.flowers' exists
298
300
======
299
301
300
302
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.
302
304
The Cypher 25 syntax makes no distinction between the names to clarify that they are considered equivalent.
303
305
304
306
.Query
@@ -318,14 +320,13 @@ Cannot create database 'garden' because another database 'garden.flowers' exists
318
320
=====
319
321
320
322
321
-
Creating a composite constituent with the same name as an existing non-composite alias is disallowed:
322
323
323
324
=== Cypher 25 specific behaviour
324
325
==== Accessing an existing alias with dots
325
326
326
327
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.
329
330
330
331
.Parameters
331
332
[source, javascript]
@@ -343,23 +344,33 @@ CYPHER 25 USE `my.garden.beautiful.flowers` RETURN 1
343
344
----
344
345
345
346
==== 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.
348
347
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.
350
350
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:
355
352
356
353
.Query
357
354
[source, cypher]
358
355
----
359
356
CYPHER 25 CREATE COMPOSITE DATABASE `my.garden`
360
357
CYPHER 25 CREATE ALIAS `my.garden.beautiful.flowers` FOR DATABASE `northwind-graph`
361
358
----
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.
363
374
364
375
365
376
@@ -369,7 +380,11 @@ Since it finds the composite database `my.garden` it will create the constituent
369
380
370
381
The composite database name and the database alias name need to be quoted individually.
371
382
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
+
====
373
388
374
389
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`:
375
390
@@ -415,7 +430,8 @@ CYPHER 5 CREATE ALIAS `my.composite.database.with.dots`.`my.other.alias.with.dot
415
430
416
431
==== Single dots and local database aliases
417
432
[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.
419
435
420
436
There is a special case for local database aliases with a single dot without any existing composite database.
421
437
If a composite database `some` exists, the query below will create a database alias named `alias` within the composite database `some`.
0 commit comments