-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructure Constraints section #1041
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have looked at 2 files so far, and had some comments I assume will be general around naming and how we refer to things.
I resolved all of these after just looking at the file they were made on, will open new comments if I see places that were missed (hopefully none XD)
modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc
Outdated
Show resolved
Hide resolved
modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc
Outdated
Show resolved
Hide resolved
modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc
Outdated
Show resolved
Hide resolved
modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc
Outdated
Show resolved
Hide resolved
modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc
Outdated
Show resolved
Hide resolved
modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc
Outdated
Show resolved
Hide resolved
This PR includes documentation updates New pages: Updated pages: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments on the not-constraint-section-files XD
| | xref:constraints/managing-constraints.adoc#create-key-constraints[Key constraints] | ||
| ensure that, for a given node label or relationship type and set of properties, all properties are present on the respective nodes or relationships, and the combination of property values is unique. | ||
| xref:constraints/managing-constraints.adoc#create-key-constraints[Key constraints] | ||
| Ensures that property values are unique and exists for all nodes with a specific label or all relationships with a specific type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Ensures that property values are unique and exists for all nodes with a specific label or all relationships with a specific type. | |
| Ensures that the combined property values are unique and all exists for all nodes with a specific label or all relationships with a specific type. |
maybe? to better match the updated property uniqueness one? 🤔
or maybe in the other order if that is better grammar
| Ensures that property values are unique and exists for all nodes with a specific label or all relationships with a specific type. | |
| Ensures that all properties exist and that the combined property values are unique for all nodes with a specific label or all relationships with a specific type. |
a| | ||
Only xref::constraints/examples.adoc#constraints-examples-node-uniqueness[node] and xref::constraints/examples.adoc#constraints-examples-relationship-uniqueness[relationship] property uniqueness constraints. | ||
Only xref::constraints/managing-constraints.adoc#create-property-uniqueness-constraints[node and relationship uniqueness constraints]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only xref::constraints/managing-constraints.adoc#create-property-uniqueness-constraints[node and relationship uniqueness constraints]. | |
Only xref::constraints/managing-constraints.adoc#create-property-uniqueness-constraints[node and relationship property uniqueness constraints]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments from looking at the updates on the syntax
page and the new version of constraints/index.adoc
(still need to check that the removed parts now is covered in the managing-constraints
file when I get to it, but one thing at the time XD)
|
||
Best practice when creating a constraint is to give the constraint a name. | ||
This name must be unique among both indexes and constraints. | ||
If a name is not explicitly given, a unique name will be auto-generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we removing the info about names?
This command creates a property uniqueness constraint on nodes with the specified label and properties. | ||
|
||
[source, syntax, role="noheader", indent=0] | ||
.Syntax for creating a node uniqueness constraint on a single property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.Syntax for creating a node uniqueness constraint on a single property | |
.Syntax for creating a node property uniqueness constraint on a single property |
---- | ||
CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] | ||
FOR (n:LabelName) | ||
REQUIRE n.propertyName IS [NODE] UNIQUE | ||
[OPTIONS "{" option: value[, ...] "}"] | ||
---- | ||
|
||
[source, syntax, role="noheader", indent=0] | ||
.Syntax for creating a composite node uniqueness constraint on multiple properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.Syntax for creating a composite node uniqueness constraint on multiple properties | |
.Syntax for creating a composite node property uniqueness constraint on multiple properties |
This command creates a property uniqueness constraint on relationships with the specified relationship type and properties. | ||
|
||
[source, syntax, role="noheader", indent=0] | ||
.Syntax for creating a relationship uniqueness constraint on a single property label:new[Introduced in 5.7] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.Syntax for creating a relationship uniqueness constraint on a single property label:new[Introduced in 5.7] | |
.Syntax for creating a relationship property uniqueness constraint on a single property label:new[Introduced in 5.7] |
---- | ||
CREATE CONSTRAINT [constraint_name] [IF NOT EXISTS] | ||
FOR ()-"["r:RELATIONSHIP_TYPE"]"-() | ||
REQUIRE r.propertyName IS [REL[ATIONSHIP]] UNIQUE | ||
[OPTIONS "{" option: value[, ...] "}"] | ||
---- | ||
|
||
[source, syntax, role="noheader", indent=0] | ||
.Syntax for creating a composite relationship uniqueness constraint on multiple properties label:new[Introduced in 5.7] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.Syntax for creating a composite relationship uniqueness constraint on multiple properties label:new[Introduced in 5.7] | |
.Syntax for creating a composite relationship property uniqueness constraint on multiple properties label:new[Introduced in 5.7] |
|
||
The returned columns from the show command is: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we are removing them from here I want a link to them from here at least
@@ -314,9 +226,8 @@ SHOW [ | |||
[WHERE expression] | |||
---- | |||
|
|||
To get the full set of output columns, a yield clause is needed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels odd to keep the description sentence for the WHERE case (The simple version of the command allows for a `WHERE` clause and will give back the default set of output columns:
) but not the YIELD case 🤔
[[constraints-syntax-list]] | ||
== Syntax for listing constraints | ||
|
||
List constraints in the database, either all or filtered on constraint type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to remove this sentence? Create doesn't seem to have them but the drop does 🤷
* *Property existence constraints* ensure that a property exists either for all nodes with a specific label or for all relationships with a specific type. | ||
label:enterprise-edition[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels odd to me that the label is on the line below and not the same line as for the other two below
* *Property existence constraints* ensure that a property exists either for all nodes with a specific label or for all relationships with a specific type. | ||
label:enterprise-edition[] | ||
* *Property type constraints* ensure that a property has the required property type for all nodes with a specific label or for all relationships with a specific type. label:enterprise-edition[] | ||
* *Key constraints* ensure that property values are unique and exists for all nodes with a specific label or all relationships with a specific type. label:enterprise-edition[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here as for the other file
* *Key constraints* ensure that property values are unique and exists for all nodes with a specific label or all relationships with a specific type. label:enterprise-edition[] | |
* *Key constraints* ensure that the combined property values are unique and all exists for all nodes with a specific label or all relationships with a specific type. label:enterprise-edition[] |
or
* *Key constraints* ensure that property values are unique and exists for all nodes with a specific label or all relationships with a specific type. label:enterprise-edition[] | |
* *Key constraints* ensure that all properties exist and that the combined property values are unique for all nodes with a specific label or all relationships with a specific type. label:enterprise-edition[] |
Before this is merged:
Fix links in Cheat Sheet and Operations Manual
Create a redirect from constraints/examples to constraints/managing-constraints