Skip to content

Commit

Permalink
Document algorithm for record:rand() generations (#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertMarashi authored Sep 25, 2024
1 parent 19946e3 commit de8e46a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/content/doc-surrealql/datamodel/ids.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Record IDs can be generated with a number of built-in ID generation functions. T

```surql
// Generate a random record ID
// Charset: `abcdefghijklmnopqrstuvwxyz0123456789`
// ID Length: 20 characters long
CREATE temperature:rand() SET time = time::now(), celsius = 37.5;
// Generate a ULID-based record ID
CREATE temperature:ulid() SET time = time::now(), celsius = 37.5;
Expand Down Expand Up @@ -209,4 +211,4 @@ FROM { temps: [-5, 8, 9] };

## Learn more

Learn more about Record IDs [in this blogpost](https://surrealdb.com/blog/the-life-changing-magic-of-surrealdb-record-ids#the-performance-at-scale) and on this [youtube video](https://www.youtube.com/watch?v=c0cqmWRYP8c).
Learn more about Record IDs [in this blogpost](https://surrealdb.com/blog/the-life-changing-magic-of-surrealdb-record-ids#the-performance-at-scale) and on this [youtube video](https://www.youtube.com/watch?v=c0cqmWRYP8c).

0 comments on commit de8e46a

Please sign in to comment.