Skip to content

Commit

Permalink
Alter database options (#735)
Browse files Browse the repository at this point in the history
Adds content for ALTER DATABASE SET/REMOVE OPTION clauses.

TODO: Update links to actual CDC documentation when published.

---------

Co-authored-by: Therese Magnusson <[email protected]>
Co-authored-by: Stefano Ottolenghi <[email protected]>
  • Loading branch information
3 people authored Sep 25, 2023
1 parent b932d6e commit 2b9a46d
Showing 1 changed file with 139 additions and 3 deletions.
142 changes: 139 additions & 3 deletions modules/ROOT/pages/administration/databases.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,24 @@ CREATE OR REPLACE COMPOSITE DATABASE name
ALTER DATABASE name [IF EXISTS]
{
SET ACCESS {READ ONLY \| READ WRITE} \|
SET TOPOLOGY n PRIMAR{Y\|IES} [m SECONDAR{Y\|IES}]
SET TOPOLOGY n PRIMAR{Y\|IES} [m SECONDAR{Y\|IES}] \|
SET OPTION option value
}
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
----

[source, syntax]
----
ALTER DATABASE name [IF EXISTS]
REMOVE OPTION option
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
----

[NOTE]
====
There can be multiple `SET OPTION` or `REMOVE OPTION` clauses for different option keys.
====

| STOP DATABASE
|
[source, syntax, role="noheader"]
Expand Down Expand Up @@ -180,7 +193,7 @@ The default for a standalone database is `neo4j://localhost:7687`. label:default
| BOOLEAN

| requestedStatus
| The expected status of the database.
| The expected status of the database.
The value can be either `online` or `offline`. label:default-output[]
| STRING

Expand Down Expand Up @@ -281,6 +294,10 @@ The lag is expressed in negative integers. In standalone environments, the value
|The names of any constituents the database may have. label:default-output[]
| LIST<STRING>

|options
|The map of options applied to the database.
| MAP

|===


Expand Down Expand Up @@ -744,6 +761,12 @@ Defines additional configuration specified by comma separated `name=value` pairs
|
Defines credentials that needs to be passed into certain seed providers.

| `txLogEnrichment`
| `FULL` \| `DIFF` \| `NONE`
|
Defines level of enrichment applied to transaction logs for Change Data Capture (CDC) purposes.
For details about enrichment mode, see link:{neo4j-docs-base-uri}/cdc/{page-version}/getting-started/enrichment-mode[Change Data Capture Manual -> Getting Started -> Enrichment mode].

|===


Expand Down Expand Up @@ -903,6 +926,118 @@ ALTER DATABASE nonExisting IF EXISTS SET TOPOLOGY 1 PRIMARY 0 SECONDARY
[role="statsonlyqueryresult"]
0 rows

[role=enterprise-edition]
[[administration-databases-alter-database-options]]
=== Options

////
[source, cypher, role=test-setup]
----
CREATE DATABASE `options-example`;
----
////

The `ALTER DATABASE` command can be used to set or remove specific options, which are listed below.

[options="header"]
|===

| Key | Value | Description

| `txLogEnrichment`
| `FULL` \| `DIFF` \| `NONE`
|
Defines level of enrichment applied to transaction logs for Change Data Capture (CDC) purposes.
For details about enrichment mode, see link:{neo4j-docs-base-uri}/cdc/{page-version}/getting-started/enrichment-mode[Change Data Capture Manual -> Getting Started -> Enrichment mode].

|===

[NOTE]
====
There are no available `OPTIONS` values for composite databases.
====

.+ALTER DATABASE SET OPTION+
======
// skip test until we make the change_data_capture feature flag on by default.
.Query
[source, cypher, role="test-skip"]
----
ALTER DATABASE `options-example`
SET OPTION txLogEnrichment 'FULL'
----
======

.+SHOW DATABASE+
======
// skip test until we make the change_data_capture feature flag on by default.
.Query
[source, cypher, role="test-skip"]
----
SHOW DATABASES yield name, options
----
// Limited result set.
// The output has been capped.
.Result
[role="queryresult",options="header,footer",cols="2*<m"]
|===
| +name+ | +options+
| +"options-example"+ | +{txLogEnrichment: "FULL"}+
| +"neo4j"+ | +{}+
| +"system"+ | +{}+
2+d|Rows: 3
|===
======

.+ALTER DATABASE REMOVE OPTION+
======
// skip test until we make the change_data_capture feature flag on by default.
.Query
[source, cypher, role="test-skip"]
----
ALTER DATABASE `options-example`
REMOVE OPTION txLogEnrichment
----
======


.+SHOW DATABASE+
======
// skip test until we make the change_data_capture feature flag on by default.
.Query
[source, cypher, role="test-skip"]
----
SHOW DATABASES YIELD name, options
----
// Limited result set.
// The output has been capped.
.Result
[role="queryresult",options="header,footer",cols="2*<m"]
|===
| +name+ | +options+
| +"options-example"+ | +{}+
| +"neo4j"+ | +{}+
| +"system"+ | +{}+
2+d|Rows: 3
|===
======


[role=enterprise-edition not-on-aura]
[[administration-databases-stop-database]]
Expand Down Expand Up @@ -1058,11 +1193,12 @@ SHOW DATABASES YIELD name
| +"library"+
| +"movies"+
| +"neo4j"+
| +"options-example"+
| +"romance"+
| +"sci-fi"+
| +"system"+
| +"topology-example"+
13+d|Rows: 8
13+d|Rows: 9
|===
Expand Down

0 comments on commit 2b9a46d

Please sign in to comment.