You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ko...@apache.org on 2022/08/22 15:55:15 UTC

[ignite-3] branch main updated: IGNITE-16860 Add info on get_random_uuid (#1026)

This is an automated email from the ASF dual-hosted git repository.

korlov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 020aa18810 IGNITE-16860 Add info on get_random_uuid (#1026)
020aa18810 is described below

commit 020aa188105712d91eb52cb2ae8344ddbb3b6478
Author: IgGusev <de...@mail.ru>
AuthorDate: Mon Aug 22 19:55:10 2022 +0400

    IGNITE-16860 Add info on get_random_uuid (#1026)
---
 docs/_docs/sql-reference/ddl.adoc | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/docs/_docs/sql-reference/ddl.adoc b/docs/_docs/sql-reference/ddl.adoc
index 7a310dccf1..dca9514813 100644
--- a/docs/_docs/sql-reference/ddl.adoc
+++ b/docs/_docs/sql-reference/ddl.adoc
@@ -23,7 +23,7 @@ Creates a new table.
 [source,sql]
 ----
 CREATE TABLE [IF NOT EXISTS] [simpleName | schemaName.simpleName] (tableColumn [, tableColumn]...)
-[COLOCATE [BY] (tableColumn [, tableColumn]...)]
+[COLOCATE [BY] (columnName [, columnName]...)]
 [ENGINE engineName]
 [WITH paramName=paramValue [,paramName=paramValue]...]
 tableColumn = columnName columnType [[NOT] NULL] [DEFAULT defaultValue] [PRIMARY KEY]
@@ -33,7 +33,7 @@ Parameters:
 
 * `tableName` - name of the table.
 * `tableColumn` - name and type of a column to be created in the new table.
-* `DEFAULT` - specifies a default value for the column. Only constant values are accepted.
+* `DEFAULT` - specifies a default value for the column. You can specify a constant value, or use a link:sql-reference/ddl#system-functions[system function] to generate a value.
 * `IF NOT EXISTS` - create the table only if a table with the same name does not exist.
 * `ENGINE` - selects the storage engine to use. Currently `pagememory` and `rocksdb` are available.
 * `COLOCATED BY` - colocation key. The key can be composite. Primary key must include colocation key. Was `affinity_key` in Ignite 2.x.
@@ -287,4 +287,22 @@ Referenced by:
 
 * link:sql-reference/ddl#сreate-table[CREATE TABLE]
 * link:sql-reference/ddl#alter-table[ALTER TABLE]
-* link:sql-reference/ddl#drop-table[DROP TABLE]
\ No newline at end of file
+* link:sql-reference/ddl#drop-table[DROP TABLE]
+
+
+= System Functions
+
+== gen_random_uuid
+
+This function generates a random UUID value each time it is called.
+
+Example:
+
+[source,sql]
+----
+CREATE TABLE t (id varchar default gen_random_uuid primary key, val int)
+----
+
+Referenced by:
+
+* link:sql-reference/ddl#create-table[CREATE TABLE]
\ No newline at end of file