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
@@ -228,11 +228,12 @@ However, when it comes to escaping names using backticks, there are some additio
228
228
Dots in alias names are ambiguous.
229
229
They could either be interpreted as part of the name itself, or as the dot that separates a composite namespace from the alias name.
230
230
231
+
[role=label--new-2025.06]
231
232
=== Conflicting names
232
-
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`.
233
-
Both of these would be referred to by the same name `garden.flowers`.
233
+
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`.
234
+
Both of these are referred to by the same name, `garden.flowers`.
234
235
235
-
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.
236
+
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.
236
237
237
238
[.tabbed-example]
238
239
=====
@@ -260,7 +261,7 @@ Failed to create the specified database alias 'garden.flowers': Database name or
260
261
======
261
262
262
263
Creating a regular alias with the same name as an existing composite constituent is disallowed.
263
-
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.
264
+
In Cypher 25, the two names are considered the same since the parts are not quoted separately as they would be in Cypher 5.
264
265
265
266
.Query
266
267
[source, cypher]
@@ -282,7 +283,8 @@ Failed to create the specified database alias 'garden.flowers': Database name or
282
283
=====
283
284
[role=include-with-cypher-5]
284
285
======
285
-
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.
286
+
Creating a composite constituent with the same name as an existing non-composite alias is disallowed.
287
+
This example scenario is already prevented on the second line; thus, the constituent on the third line cannot be created.
286
288
287
289
.Query
288
290
[source, cypher]
@@ -304,7 +306,7 @@ Cannot create database 'garden' because another database 'garden.flowers' exists
304
306
======
305
307
306
308
Creating a composite constituent with the same name as an existing non-composite alias is disallowed.
307
-
This example scenario is prevented already on the second line, thus the constituent on the third line cannot be created.
309
+
This example scenario is already prevented on the second line; thus, the constituent on the third line cannot be created.
308
310
The Cypher 25 syntax makes no distinction between the names to clarify that they are considered equivalent.
309
311
310
312
.Query
@@ -324,14 +326,13 @@ Cannot create database 'garden' because another database 'garden.flowers' exists
324
326
=====
325
327
326
328
327
-
Creating a composite constituent with the same name as an existing non-composite alias is disallowed:
328
329
329
330
=== Cypher 25 specific behaviour
330
331
==== Accessing an existing alias with dots
331
332
332
333
Cypher 25 relies on the guarantee that no conflicting names are allowed in Neo4j 2025.06 and later.
333
-
The following queries all act on the same alias, regardless if that alias is a composite constituent or not.
334
-
The special quoting of separate name parts that was necessary in Cypher 5 is not permitted in Cypher 25.
334
+
The following queries all act on the same alias, regardless of whether that alias is a composite constituent or not.
335
+
The special quoting of separate name parts that is necessary in Cypher 5 is not permitted in Cypher 25.
335
336
336
337
.Parameters
337
338
[source, javascript]
@@ -349,23 +350,33 @@ CYPHER 25 USE `my.garden.beautiful.flowers` RETURN 1
349
350
----
350
351
351
352
==== Creating a new alias with dots
352
-
During `CREATE`, Cypher 25 will split the given name on each dot, left to right, and check if a corresponding composite database exists.
353
-
If no composite database is found, Cypher25 will fall back to creating a regular non-composite alias instead.
354
353
355
-
The following query attempts to create in order:
354
+
During `CREATE`, Cypher 25 splits the given name on each dot, left to right, and checks if a corresponding composite database exists.
355
+
If no composite database is found, Cypher25 falls back to creating a regular non-composite alias.
356
+
357
+
For example:
358
+
359
+
.Query
360
+
[source, cypher]
361
+
----
362
+
CYPHER 25 CREATE COMPOSITE DATABASE `my.garden`
363
+
CYPHER 25 CREATE ALIAS `my.garden.beautiful.flowers` FOR DATABASE `northwind-graph`
364
+
----
365
+
366
+
The query attempts to create the following aliases in the given order:
356
367
357
-
* Constituent alias `garden.beautiful.flowers` within composite database `my`.
358
-
* Constituent alias `beautiful.flowers` within composite database `my.garden`.
359
-
* Constituent alias `flowers` within composite database `my.garden.beautiul`.
360
-
* Regular non-composite alias `my.garden.beautiful.flowers`.
368
+
. Constituent alias `garden.beautiful.flowers` within composite database `my`.
369
+
. Constituent alias `beautiful.flowers` within composite database `my.garden`.
370
+
. Constituent alias `flowers` within composite database `my.garden.beautiful`.
371
+
. Regular non-composite alias `my.garden.beautiful.flowers`.
361
372
362
373
.Query
363
374
[source, cypher]
364
375
----
365
376
CYPHER 25 CREATE COMPOSITE DATABASE `my.garden`
366
377
CYPHER 25 CREATE ALIAS `my.garden.beautiful.flowers` FOR DATABASE `northwind-graph`
367
378
----
368
-
Since it finds the composite database `my.garden` it will create the constituent alias `beautiful.flowers` within the found composite.
379
+
When it finds the composite database `my.garden`, it creates the constituent alias `beautiful.flowers` within that composite.
369
380
370
381
371
382
@@ -375,7 +386,11 @@ Since it finds the composite database `my.garden` it will create the constituent
375
386
376
387
The composite database name and the database alias name need to be quoted individually.
377
388
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`++`.
378
-
Note however that separating composite database name and alias name with backticks is no longer supported in Cypher 25.
389
+
[NOTE]
390
+
====
391
+
Separating composite database name and alias name with backticks is no longer supported in Cypher 25.
392
+
See <<_cypher_25_specific_behaviour, Cypher 25 specific behaviour>> for details.
393
+
====
379
394
380
395
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`:
381
396
@@ -421,7 +436,8 @@ CYPHER 5 CREATE ALIAS `my.composite.database.with.dots`.`my.other.alias.with.dot
421
436
422
437
==== Single dots and local database aliases
423
438
[NOTE]
424
-
This used to be deprecated, but the deprecation has since been revoked.
439
+
====
440
+
As of Neo4j 2025.06, this feature is no longer deprecated.
425
441
426
442
There is a special case for local database aliases with a single dot without any existing composite database.
427
443
If a composite database `some` exists, the query below will create a database alias named `alias` within the composite database `some`.
0 commit comments