Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ See xref:database-internals/store-formats.adoc[Store formats], for more details

=== Syntax

[options="header", width="100%", cols="1m,5a"]
[.tabbed-example]
=====
[role=include-with-Cypher-5]
======
[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax
Expand All @@ -57,8 +62,37 @@ CREATE OR REPLACE DATABASE name
[OPTIONS "{" option: value[, ...] "}"]
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
----
|===

======

[role=include-with-Cypher-25]
======

[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax
| CREATE DATABASE
|
[source, syntax, role="noheader"]
----
CREATE DATABASE name [IF NOT EXISTS]
[[SET] TOPOLOGY n PRIMAR{Y\|IES} [m SECONDAR{Y\|IES}]]
[OPTIONS "{" option: value[, ...] "}"]
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
----

[source, syntax, role="noheader"]
----
CREATE OR REPLACE DATABASE name
[[SET] TOPOLOGY n PRIMAR{Y\|IES} [m SECONDAR{Y\|IES}]]
[OPTIONS "{" option: value[, ...] "}"]
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
----
|===

======
=====


[[manage-databases-create-database-options]]
Expand Down
131 changes: 123 additions & 8 deletions modules/ROOT/pages/database-administration/syntax.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ REQUIRE n.propertyName IS NOT NULL
[[administration-syntax-database-management]]
== Database management command syntax

The below table covers both standard and composite databases.
The following tables cover both standard and composite databases.

=== Show databases

[options="header", width="100%", cols="1m,5a"]
|===
Expand All @@ -99,6 +101,17 @@ YIELD { * \| field[, ...] } [ORDER BY field[, ...]] [SKIP n] [LIMIT n]
[WHERE expression]
[RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
----
|===

=== Create a database

[.tabbed-example]
=====
[role=include-with-Cypher-5]
======
[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax

| CREATE DATABASE
|
Expand All @@ -117,6 +130,42 @@ CREATE OR REPLACE DATABASE name
[OPTIONS "{" option: value[, ...] "}"]
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
----
|===

======

[role=include-with-Cypher-25]
======

[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax
| CREATE DATABASE
|
[source, syntax, role="noheader"]
----
CREATE DATABASE name [IF NOT EXISTS]
[[SET] TOPOLOGY n PRIMAR{Y\|IES} [m SECONDAR{Y\|IES}]]
[OPTIONS "{" option: value[, ...] "}"]
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
----

[source, syntax, role="noheader"]
----
CREATE OR REPLACE DATABASE name
[[SET] TOPOLOGY n PRIMAR{Y\|IES} [m SECONDAR{Y\|IES}]]
[OPTIONS "{" option: value[, ...] "}"]
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
----
|===

======
=====
=== Create a composite database

[options="header", width="100%", cols="2m,4a"]
|===
| Command | Syntax

| CREATE COMPOSITE DATABASE
|
Expand All @@ -133,6 +182,13 @@ CREATE OR REPLACE COMPOSITE DATABASE name
[OPTIONS "{" "}"]
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
----
|===

=== Alter a database

[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax

| ALTER DATABASE
|
Expand All @@ -158,21 +214,41 @@ REMOVE OPTION option
====
There can be multiple `SET OPTION` or `REMOVE OPTION` clauses for different option keys.
====
|===

=== Stop a database

[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax

| STOP DATABASE
|
[source, syntax, role="noheader"]
----
STOP DATABASE name [WAIT [n [SEC[OND[S]]]]\|NOWAIT]
----
|===

=== Start a database

[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax

| START DATABASE
|
[source, syntax, role="noheader"]
----
START DATABASE name [WAIT [n [SEC[OND[S]]]]\|NOWAIT]
----
|===

=== Delete a database

[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax

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

[options="header", width="100%", cols="1,5a"]
The following tables cover both local and remote database aliases.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that it is only the very next table which cover both, after that it is separate tables for local and remote since there are some variations. So I think you either want to write just "The following table..." instead of "The following tables..." or clarify it a bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's the general tables as in all of these tables together covers both? but that sentence came from @renetapopova so I'll let her decide if we want to update it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it better to just remove the both?

Suggested change
The following tables cover both local and remote database aliases.
The following tables cover local and remote database aliases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I do not think removing 'both' helps. I interpret this sentence as each of the following tables (unclear how many) covers both local and remote alias, which is not true. Some tables cover both, some cover local and some cover remote if I understand the layout of the page correctly

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it is just me that interpret the sentence incorrectly, if you think it is correct already I am fine with leaving it. Same for my other comment which is about the same thing but in another place

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The following tables cover both local and remote database aliases.
The following sections cover the commands related to local and remote database aliases.

is that better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or feel free to come up with your own suggestion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the sentence isn't supposed to talk about just the next one so changing to The following table isn't the way to go


=== Show aliases

[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax
| Show Database Alias
| SHOW ALIAS
|
[source, syntax, role=noheader]
-----
Expand All @@ -204,8 +284,15 @@ YIELD { * \| field[, ...] } [ORDER BY field[, ...]] [SKIP n] [LIMIT n]
[RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
-----
Lists both local and remote database aliases, optionally filtered on the alias name.
|===

=== Create a local alias

| Create Local Alias
[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax

| CREATE ALIAS
|
[source, syntax, role=noheader]
-----
Expand All @@ -217,8 +304,15 @@ CREATE ALIAS name [IF NOT EXISTS] FOR DATABASE targetName
CREATE OR REPLACE ALIAS name FOR DATABASE targetName
[PROPERTIES "{" key: value[, ...] "}"]
-----
|===

=== Create a remote alias

| Create Remote Alias
[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax

| CREATE ALIAS
|
[source, syntax, role=noheader]
-----
Expand All @@ -234,17 +328,30 @@ AT 'url' USER username PASSWORD 'password'
[DRIVER "{" setting: value[, ...] "}"]
[PROPERTIES "{" key: value[, ...] "}"]
-----
|===

=== Alter a local alias

| Alter Local Alias
[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax

|ALTER ALIAS
|
[source, syntax, role=noheader]
-----
ALTER ALIAS name [IF EXISTS] SET DATABASE
[TARGET targetName]
[PROPERTIES "{" key: value[, ...] "}"]
-----
|===

| Alter Remote Alias
=== Alter a remote alias

[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax
|ALTER ALIAS
|
[source, syntax, role=noheader]
-----
Expand All @@ -256,7 +363,15 @@ ALTER ALIAS name [IF EXISTS] SET DATABASE
[PROPERTIES "{" key: value[, ...] "}"]
-----

| Drop Alias
|===

=== Delete an alias

[options="header", width="100%", cols="1m,5a"]
|===
| Command | Syntax

| DROP ALIAS
|
[source, syntax, role=noheader]
-----
Expand Down