Skip to content

Commit e4d42e6

Browse files
Add optional SET keyword for create database clauses in Cypher 25 (#2216)
Co-authored-by: Reneta Popova <[email protected]>
1 parent 51fec9e commit e4d42e6

File tree

2 files changed

+157
-8
lines changed

2 files changed

+157
-8
lines changed

modules/ROOT/pages/database-administration/standard-databases/create-databases.adoc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ See xref:database-internals/store-formats.adoc[Store formats], for more details
3939

4040
=== Syntax
4141

42+
[options="header", width="100%", cols="1m,5a"]
43+
[.tabbed-example]
44+
=====
45+
[role=include-with-Cypher-5]
46+
======
4247
[options="header", width="100%", cols="1m,5a"]
4348
|===
4449
| Command | Syntax
@@ -60,9 +65,38 @@ CREATE OR REPLACE DATABASE name
6065
[OPTIONS "{" option: value[, ...] "}"]
6166
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
6267
----
68+
|===
69+
70+
======
71+
72+
[role=include-with-Cypher-25]
73+
======
74+
75+
[options="header", width="100%", cols="1m,5a"]
76+
|===
77+
| Command | Syntax
78+
| CREATE DATABASE
79+
|
80+
[source, syntax, role="noheader"]
81+
----
82+
CREATE DATABASE name [IF NOT EXISTS]
83+
[[SET] TOPOLOGY n PRIMAR{Y\|IES} [m SECONDAR{Y\|IES}]]
84+
[OPTIONS "{" option: value[, ...] "}"]
85+
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
86+
----
6387

88+
[source, syntax, role="noheader"]
89+
----
90+
CREATE OR REPLACE DATABASE name
91+
[[SET] TOPOLOGY n PRIMAR{Y\|IES} [m SECONDAR{Y\|IES}]]
92+
[OPTIONS "{" option: value[, ...] "}"]
93+
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
94+
----
6495
|===
6596

97+
======
98+
=====
99+
66100

67101
[[manage-databases-create-database-options]]
68102
=== Options

modules/ROOT/pages/database-administration/syntax.adoc

Lines changed: 123 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ REQUIRE n.propertyName IS NOT NULL
7878
[[administration-syntax-database-management]]
7979
== Database management command syntax
8080

81-
The below table covers both standard and composite databases.
81+
The database management commands are used to manage standard or composite databases.
82+
83+
=== Show databases
8284

8385
[options="header", width="100%", cols="1m,5a"]
8486
|===
@@ -99,6 +101,17 @@ YIELD { * \| field[, ...] } [ORDER BY field[, ...]] [SKIP n] [LIMIT n]
99101
[WHERE expression]
100102
[RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
101103
----
104+
|===
105+
106+
=== Create a database
107+
108+
[.tabbed-example]
109+
=====
110+
[role=include-with-Cypher-5]
111+
======
112+
[options="header", width="100%", cols="1m,5a"]
113+
|===
114+
| Command | Syntax
102115

103116
| CREATE DATABASE
104117
|
@@ -117,6 +130,42 @@ CREATE OR REPLACE DATABASE name
117130
[OPTIONS "{" option: value[, ...] "}"]
118131
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
119132
----
133+
|===
134+
135+
======
136+
137+
[role=include-with-Cypher-25]
138+
======
139+
140+
[options="header", width="100%", cols="1m,5a"]
141+
|===
142+
| Command | Syntax
143+
| CREATE DATABASE
144+
|
145+
[source, syntax, role="noheader"]
146+
----
147+
CREATE DATABASE name [IF NOT EXISTS]
148+
[[SET] TOPOLOGY n PRIMAR{Y\|IES} [m SECONDAR{Y\|IES}]]
149+
[OPTIONS "{" option: value[, ...] "}"]
150+
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
151+
----
152+
153+
[source, syntax, role="noheader"]
154+
----
155+
CREATE OR REPLACE DATABASE name
156+
[[SET] TOPOLOGY n PRIMAR{Y\|IES} [m SECONDAR{Y\|IES}]]
157+
[OPTIONS "{" option: value[, ...] "}"]
158+
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
159+
----
160+
|===
161+
162+
======
163+
=====
164+
=== Create a composite database
165+
166+
[options="header", width="100%", cols="2m,4a"]
167+
|===
168+
| Command | Syntax
120169

121170
| CREATE COMPOSITE DATABASE
122171
|
@@ -133,6 +182,13 @@ CREATE OR REPLACE COMPOSITE DATABASE name
133182
[OPTIONS "{" "}"]
134183
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
135184
----
185+
|===
186+
187+
=== Alter a database
188+
189+
[options="header", width="100%", cols="1m,5a"]
190+
|===
191+
| Command | Syntax
136192

137193
| ALTER DATABASE
138194
|
@@ -158,21 +214,41 @@ REMOVE OPTION option
158214
====
159215
There can be multiple `SET OPTION` or `REMOVE OPTION` clauses for different option keys.
160216
====
217+
|===
218+
219+
=== Stop a database
161220

221+
[options="header", width="100%", cols="1m,5a"]
222+
|===
223+
| Command | Syntax
162224

163225
| STOP DATABASE
164226
|
165227
[source, syntax, role="noheader"]
166228
----
167229
STOP DATABASE name [WAIT [n [SEC[OND[S]]]]\|NOWAIT]
168230
----
231+
|===
232+
233+
=== Start a database
234+
235+
[options="header", width="100%", cols="1m,5a"]
236+
|===
237+
| Command | Syntax
169238

170239
| START DATABASE
171240
|
172241
[source, syntax, role="noheader"]
173242
----
174243
START DATABASE name [WAIT [n [SEC[OND[S]]]]\|NOWAIT]
175244
----
245+
|===
246+
247+
=== Delete a database
248+
249+
[options="header", width="100%", cols="1m,5a"]
250+
|===
251+
| Command | Syntax
176252

177253
| DROP DATABASE
178254
|
@@ -186,10 +262,14 @@ DROP [COMPOSITE] DATABASE name [IF EXISTS] [RESTRICT \| CASCADE ALIAS[ES]] [{DUM
186262
[[administration-syntax-database-alias-management]]
187263
== Database alias management command syntax
188264

189-
[options="header", width="100%", cols="1,5a"]
265+
The database alias management commands are used to manage local or remote database aliases.
266+
267+
=== Show aliases
268+
269+
[options="header", width="100%", cols="1m,5a"]
190270
|===
191271
| Command | Syntax
192-
| Show Database Alias
272+
| SHOW ALIAS
193273
|
194274
[source, syntax, role=noheader]
195275
-----
@@ -204,8 +284,15 @@ YIELD { * \| field[, ...] } [ORDER BY field[, ...]] [SKIP n] [LIMIT n]
204284
[RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
205285
-----
206286
Lists both local and remote database aliases, optionally filtered on the alias name.
287+
|===
288+
289+
=== Create a local alias
207290

208-
| Create Local Alias
291+
[options="header", width="100%", cols="1m,5a"]
292+
|===
293+
| Command | Syntax
294+
295+
| CREATE ALIAS
209296
|
210297
[source, syntax, role=noheader]
211298
-----
@@ -217,8 +304,15 @@ CREATE ALIAS name [IF NOT EXISTS] FOR DATABASE targetName
217304
CREATE OR REPLACE ALIAS name FOR DATABASE targetName
218305
[PROPERTIES "{" key: value[, ...] "}"]
219306
-----
307+
|===
308+
309+
=== Create a remote alias
220310

221-
| Create Remote Alias
311+
[options="header", width="100%", cols="1m,5a"]
312+
|===
313+
| Command | Syntax
314+
315+
| CREATE ALIAS
222316
|
223317
[source, syntax, role=noheader]
224318
-----
@@ -234,17 +328,30 @@ AT 'url' USER username PASSWORD 'password'
234328
[DRIVER "{" setting: value[, ...] "}"]
235329
[PROPERTIES "{" key: value[, ...] "}"]
236330
-----
331+
|===
332+
333+
=== Alter a local alias
237334

238-
| Alter Local Alias
335+
[options="header", width="100%", cols="1m,5a"]
336+
|===
337+
| Command | Syntax
338+
339+
|ALTER ALIAS
239340
|
240341
[source, syntax, role=noheader]
241342
-----
242343
ALTER ALIAS name [IF EXISTS] SET DATABASE
243344
[TARGET targetName]
244345
[PROPERTIES "{" key: value[, ...] "}"]
245346
-----
347+
|===
246348

247-
| Alter Remote Alias
349+
=== Alter a remote alias
350+
351+
[options="header", width="100%", cols="1m,5a"]
352+
|===
353+
| Command | Syntax
354+
|ALTER ALIAS
248355
|
249356
[source, syntax, role=noheader]
250357
-----
@@ -256,7 +363,15 @@ ALTER ALIAS name [IF EXISTS] SET DATABASE
256363
[PROPERTIES "{" key: value[, ...] "}"]
257364
-----
258365

259-
| Drop Alias
366+
|===
367+
368+
=== Delete an alias
369+
370+
[options="header", width="100%", cols="1m,5a"]
371+
|===
372+
| Command | Syntax
373+
374+
| DROP ALIAS
260375
|
261376
[source, syntax, role=noheader]
262377
-----

0 commit comments

Comments
 (0)