smiklosovic commented on code in PR #3907:
URL: https://github.com/apache/cassandra/pull/3907#discussion_r1971839750


##########
doc/modules/cassandra/pages/developing/cql/constraints.adoc:
##########
@@ -92,6 +92,31 @@ Finally, the constraint can be removed:
 ALTER TABLE keyspace.table ALTER name DROP CHECK;
 ----
 
+=== OCTET_LENGTH CONSTRAINT
+
+Defines a condition that checks the size in bytes of text or binary type.
+
+For example, we can create a constraint that checks that name can't be bigger 
than 256 characters:
+
+----
+CREATE TABLE keyspace.table (
+       name text CHECK OCTET_LENGTH(name) < 256
+       ...,
+);
+----
+
+Altering that constraint can be done with:
+
+----
+ALTER TABLE keyspace.table ALTER name OCTET_LENGTH(name) < 512;
+----
+
+Finally, the constraint can be removed:
+
+----
+ALTER TABLE keyspace.table ALTER name DROP CHECK;

Review Comment:
   I would not do this. This is obvious already. I would put there examples of 
the usage instead. Happy path and how failure would look like.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to