View Source surreal_entity (surreal v2.1.0)

Module for representing Table or Record ID.

Link to this section Summary

Types

An identifier that serves as a unique reference for entities within a database, encompassing both database tables and record identifiers.

A tuple representing a database record's location using the table name and a unique identifier.

A type that can represent either an entity identifier or a record specification.

Link to this section Types

Link to this type

entity_identifier/0

View Source (since 2.1.0)
-type entity_identifier() :: iodata().

An identifier that serves as a unique reference for entities within a database, encompassing both database tables and record identifiers.

- "employees": Represents the table containing employee records.

- "employees:meppu": Identifies a specific employee record.
Link to this type

record_specification/0

View Source (since 2.1.0)
-type record_specification() :: {Table :: iodata(), Id :: iodata()}.

A tuple representing a database record's location using the table name and a unique identifier.

- {"employees", "meppu"}: Refers to an employee record in the employees table.
-type thing() :: entity_identifier() | record_specification().
A type that can represent either an entity identifier or a record specification.

Link to this section Functions

Link to this function

convert(Thing)

View Source (since 2.1.0)
-spec convert(Thing :: thing()) -> entity_identifier().
Converts given thing() to entity_identifier().