The Mojo SDK ships CBOR encoders and decoders for the SurrealDB tagged value types. These types live in the surrealdb.value module and map directly onto the values SurrealDB stores and returns.
Record identifiers
A RecordId pairs a table with a record key. Its to_string() returns the canonical table:id form.
Table wraps a table name on its own.
Scalar types
| Type | Fields | Description |
|---|---|---|
Uuid | value | A UUID string. |
DateTime | seconds, nanos | A point in time, split into seconds and nanoseconds. |
Duration | seconds, nanos | A length of time. |
Decimal | value | An arbitrary-precision decimal, held as a string. |
FileRef | bucket, key | A reference to a file in a bucket. |
SurrealSet | items | A set of values. |
FutureValue | body | A computed (future) value, held as its expression body. |
Ranges
A RangeValue describes a bounded range. Its bounds are BoundIncluded or BoundExcluded, set on the begin_included, begin_excluded, end_included, and end_excluded fields.
Geometry
The SDK models the full GeoJSON family:
GeometryPointwithlongitudeandlatitude.GeometryLineandGeometryPolygon.GeometryMultiPoint,GeometryMultiLine, andGeometryMultiPolygon.GeometryCollection, holding points, lines, and polygons together.