> Full SurrealDB documentation index: https://surrealdb.com/docs/llms.txt

# Go values

Value types in the models package of the Go SDK and the SurrealDB types they map to: RecordID, Table, CustomDateTime, CustomDuration, UUID, Set, Range, geometry, File, Float16, DecimalString, BigDecimal, PlainDate, PlainTime, Timestamp, Interval, Regex and None, with the type mapping table.

The Go SDK maps most SurrealDB values onto Go's own types, such as `string`, `bool`, `int64`, `time.Time` and `map[string]any`. Go has no type for some values, such as record IDs, geometry and the SurrealDB 4.0 kinds. For these values, the SDK has types in the `models` package, and this section has a page for each type. This page lists the types and maps each SurrealDB type onto its Go type. For a guide to how values convert, with examples, see [Value types](/docs/reference/golang/concepts/value-types.md).

```go title="Import"
import "github.com/surrealdb/surrealdb.go/v2/pkg/models"
```

## Value types {#value-types}

- **[CustomDateTime](/docs/reference/golang/api/values/datetime.md):** `CustomDateTime` wraps `time.Time` for a datetime. The SDK also sends a `time.Time` as a datetime.
- **[CustomDuration](/docs/reference/golang/api/values/duration.md):** `CustomDuration` wraps `time.Duration` for a duration. The SDK also sends a `time.Duration` as a duration.
- **[Geometry](/docs/reference/golang/api/values/geometry.md):** `GeometryPoint` and six other types for GeoJSON geometry.
- **[Range](/docs/reference/golang/api/values/range.md):** `Range` with `BoundIncluded` and `BoundExcluded`, for a span of values or of record IDs.
- **[RecordID](/docs/reference/golang/api/values/record-id.md):** `RecordID` names one record by its table and ID.
- **[Table](/docs/reference/golang/api/values/table.md):** `Table` names a table.
- **[UUID](/docs/reference/golang/api/values/uuid.md):** `UUID` holds a UUID.
- **[Set](/docs/reference/golang/api/values/set.md):** `Set` holds the distinct values of a set.
- **[Numbers](/docs/reference/golang/api/values/numbers.md):** `Float16`, `DecimalString` and `BigDecimal`, and the Go types for the sized numbers of SurrealDB 4.0.
- **[Dates, times and intervals](/docs/reference/golang/api/values/temporal.md):** `PlainDate`, `PlainTime`, `Timestamp` and `Interval`, for the calendar kinds of SurrealDB 4.0.
- **[Regex](/docs/reference/golang/api/values/regex.md):** `Regex` holds a pattern for the `regex` kind of SurrealDB 4.0.
- **[File](/docs/reference/golang/api/values/file.md):** `File` points to a file in a bucket.

## Type mapping {#type-mapping}

| SurrealDB | Go | Page |
| --- | --- | --- |
| `NONE` | `models.None` to send; `nil` when decoded | [Value types](/docs/reference/golang/concepts/value-types.md#none-and-null) |
| `NULL` | `nil` | [Value types](/docs/reference/golang/concepts/value-types.md#none-and-null) |
| `bool` | `bool` | |
| `int` | `int`, `int64`, and the other integer types | [Numbers](/docs/reference/golang/api/values/numbers.md) |
| `float` | `float64` | [Numbers](/docs/reference/golang/api/values/numbers.md) |
| `decimal` | `models.DecimalString` | [Numbers](/docs/reference/golang/api/values/numbers.md#decimalstring) |
| `string` | `string` | |
| `bytes` | `[]byte` | |
| `datetime` | `time.Time`, `models.CustomDateTime` | [CustomDateTime](/docs/reference/golang/api/values/datetime.md) |
| `duration` | `time.Duration`, `models.CustomDuration` | [CustomDuration](/docs/reference/golang/api/values/duration.md) |
| `uuid` | `models.UUID` | [UUID](/docs/reference/golang/api/values/uuid.md) |
| `record` | `models.RecordID` | [RecordID](/docs/reference/golang/api/values/record-id.md) |
| `table` | `models.Table` | [Table](/docs/reference/golang/api/values/table.md) |
| `array` | `[]any` or a typed slice | |
| `object` | `map[string]any` or a struct | |
| `set` | `models.Set` | [Set](/docs/reference/golang/api/values/set.md) |
| `range` | `models.Range` | [Range](/docs/reference/golang/api/values/range.md) |
| `geometry` | `models.GeometryPoint` and the other geometry types | [Geometry](/docs/reference/golang/api/values/geometry.md) |
| `file` | `models.File` | [File](/docs/reference/golang/api/values/file.md) |
| `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `u64` | `int8`, `uint8`, `int16`, `uint16`, `int32`, `uint32`, `uint64` | [Numbers](/docs/reference/golang/api/values/numbers.md#sized-numbers) |
| `f16`, `f32` | `models.Float16`, `float32` | [Numbers](/docs/reference/golang/api/values/numbers.md#sized-numbers) |
| `bigdecimal` | `models.BigDecimal` | [Numbers](/docs/reference/golang/api/values/numbers.md#bigdecimal) |
| `date`, `time`, `timestamp`, `interval` | `models.PlainDate`, `PlainTime`, `Timestamp`, `Interval` | [Dates, times and intervals](/docs/reference/golang/api/values/temporal.md) |
| `regex` | `models.Regex` | [Regex](/docs/reference/golang/api/values/regex.md) |

The SurrealDB 4.0 kinds, from `i8` to `regex`, keep their type over cbor.2 only. With a server before 4.0, the SDK and the server send them as the nearest older kind, as [Value types](/docs/reference/golang/concepts/value-types.md#surrealdb-40-kinds) describes.

## See also

- [Value types](/docs/reference/golang/concepts/value-types.md) for how values convert, with examples
- [SurrealQL data types](/docs/reference/query-language/language-primitives/data-types.md) for the type system of SurrealDB
