summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorLily Acorn <code@lilyf.org>2025-11-15 16:29:12 +0000
committerJacob Walls <jacobtylerwalls@gmail.com>2025-12-12 11:17:08 -0500
commitaccceec9493d08e19d59fa1a59f69c0fdf23bb13 (patch)
tree76fb22d06b9fa3074317a477b713c06fa68ddc12 /docs/ref
parent8932a677258fbda34f24a1be6f426265148b0003 (diff)
Fixed #36735 -- Added UUID4 and UUID7 database functions.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/postgres/functions.txt5
-rw-r--r--docs/ref/models/database-functions.txt33
2 files changed, 38 insertions, 0 deletions
diff --git a/docs/ref/contrib/postgres/functions.txt b/docs/ref/contrib/postgres/functions.txt
index 39d74917da..ba73d26f06 100644
--- a/docs/ref/contrib/postgres/functions.txt
+++ b/docs/ref/contrib/postgres/functions.txt
@@ -21,6 +21,11 @@ Usage example:
>>> from django.contrib.postgres.functions import RandomUUID
>>> Article.objects.update(uuid=RandomUUID())
+.. admonition:: Use :class:`django.db.models.functions.UUID4` instead.
+
+ :class:`django.db.models.functions.UUID4` is a cross-database version of
+ this function. ``RandomUUID`` may be deprecated in the future.
+
``TransactionNow``
==================
diff --git a/docs/ref/models/database-functions.txt b/docs/ref/models/database-functions.txt
index 76c6362da9..cf251a758d 100644
--- a/docs/ref/models/database-functions.txt
+++ b/docs/ref/models/database-functions.txt
@@ -1878,6 +1878,39 @@ Usage example:
.. _window-functions:
+UUID functions
+==============
+
+``UUID4``
+---------
+
+.. versionadded:: 6.1
+
+.. class:: UUID4()
+
+Generates a :rfc:`version 4 UUID <9562#section-5.4>`, which is random and is
+generated using a cryptographically secure method.
+
+.. admonition:: Availability
+
+ Available on PostgreSQL, SQLite, MariaDB version 11.7 or later, and Oracle
+ 23ai/26ai (23.9) or later.
+
+``UUID7``
+---------
+
+.. versionadded:: 6.1
+
+.. class:: UUID7()
+
+Generates a :rfc:`version 7 UUID <9562#section-5.7>`, which starts with a
+time-based component.
+
+.. admonition:: Availability
+
+ Available on PostgreSQL version 18 or later, MariaDB version 11.7 or later,
+ and SQLite on Python version 3.14 or later.
+
Window functions
================