UUID
The UUID struct wraps the github.com/gofrs/uuid package and handles CBOR encoding with tag 37 as specified by SurrealDB. It supports both UUID v4 and v7 values.
Package: github.com/surrealdb/surrealdb.go/pkg/models
Source: pkg/models/uuid.go
Definition
UUID embeds github.com/gofrs/uuid.UUID, so all methods from that package are available directly.
Related Types
UUIDString
A string type for UUID values that prefer string representation. Encoded with CBOR tag 9.
CBOR Encoding
UUID is encoded as CBOR tag 37 containing the 16-byte binary representation. UUIDString is encoded as CBOR tag 9 containing the string representation.
Usage
UUID is returned by live query functions and session/transaction creation. You typically receive it from the SDK rather than constructing it manually.
See Also
Live queries for live query UUIDs
Session for session UUIDs
Transaction for transaction UUIDs
Value types for the full type mapping
SurrealQL UUID type for the underlying data model