• Start

Language Primitives

/

Data types

UUIDs

UUID values in SurrealQL represent UUID v4 and v7 values.

UUIDs represent UUID v4 and v7 values. They can be obtained via either the:

Note

SurrealDB does not eagerly convert a string into a UUID. An implicit u prefix or cast using <uuid> is required instead.

/**[test]

[[test.results]]
value = "u'4048a7ac-9c1a-486e-9a12-e39d76670eac'"
skip-uuid = true

[[test.results]]
value = "u'0199a85c-5e24-7901-9053-9d898d881d9e'"
skip-uuid = true

[[test.results]]
value = "u'a8f30d8b-db67-47ec-8b38-ef703e05ad1b'"
skip-uuid = true

[[test.results]]
value = "u'a8f30d8b-db67-47ec-8b38-ef703e05ad1b'"
skip-uuid = true

*/

rand::uuid::v4();
rand::uuid::v7();
<uuid> "a8f30d8b-db67-47ec-8b38-ef703e05ad1b";
u"a8f30d8b-db67-47ec-8b38-ef703e05ad1b";

Was this page helpful?