Skip to content

Commit

Permalink
DOC-244: Note that eager conversion will be a thing of the past (#783)
Browse files Browse the repository at this point in the history
Co-authored-by: Obinna Ekwuno <[email protected]>
  • Loading branch information
Dhghomon and Ekwuno authored Aug 22, 2024
1 parent 902a214 commit f21a232
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ SELECT id FROM <record> (s"person:hrebrffwm4sr2yifglta");;

The &lt;uuid&gt; casting function converts a value into a UUID.

Keep in mind when using this casting function that if the equivalent record id does not exist, it will not return anything.

```surql
SELECT id FROM <uuid> "a8f30d8b-db67-47ec-8b38-ef703e05ad1b";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
sidebar_position: 14
sidebar_label: Datetimes
title: Datetimes | SurrealQL
description: SurrealDB has native support for datetimes with nanosecond precision. SurrealDB automatically parses and understands datetimes which are written as strings in the SurrealQL language.
description: SurrealDB has native support for datetimes with nanosecond precision. SurrealDB is able to parse datetimes from strings.

---


# Datetimes

SurrealDB has native support for datetimes with nanosecond precision. SurrealDB automatically parses and understands datetimes which are written as strings in the SurrealQL language. Times must also be formatted in an [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format.

:::note
__NOTE:__ As of `v2.0.0`, SurrealDB no longer eagerly converts a string into a datetime. An implicit `d` prefix or cast using `<datetime>` is required instead.
:::

```surql
CREATE event SET time = d"2023-07-03T07:18:52Z";
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ An example of a record ID can look like this: `table:record_identifier`.
Record IDs can be constructed using a number of different types of values, including text, numbers, objects, and arrays. For example, by default when you [create a table](/docs/surrealdb/surrealql/statements/create), `create internet`, a random id is assigned. This differs from the traditional default of auto-increment or serial IDs you might be used to.


:::note
__NOTE:__ As of `v2.0.0`, SurrealDB no longer eagerly converts a string into a record. An implicit `r` prefix or cast using `<record>` (or `<record<recordname>>`) is required instead.
:::

### Text Record IDs
Without annotation, text record IDs can contain letters, numbers and `_` characters.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ UUIDs represent UUID v4 and v7 values. They can be obtained via either the:
- [casted from strings](/docs/surrealdb/surrealql/datamodel/casting#uuid)
- or via [string prefixes](/docs/surrealdb/surrealql/datamodel/strings#uuid)

:::note
__NOTE:__ As of `v2.0.0`, SurrealDB no longer eagerly converts a string into a UUID. An implicit `u` prefix or cast using `<uuid>` is required instead.
:::

```surql
rand::uuid::v4();
rand::uuid::v7();
Expand Down

0 comments on commit f21a232

Please sign in to comment.