types
Types
The value types Marreta uses for schema contracts, payloads, responses, and runtime values.
Marreta uses one set of types everywhere. The same types describe schema contracts,
request payloads, responses, and the values your code works with at runtime. A field
declared amount: decimal is validated on the way in, shaped on the way out, and is a
real decimal in between.
Scalar types
| Type | Meaning | Page |
|---|
string | Text. | string |
integer | A whole number. | integer |
float | A floating-point number. | float |
decimal | An exact decimal, safe for money. | decimal |
boolean | true or false. | boolean |
Collection types
| Type | Meaning | Page |
|---|
list | An ordered list of values. | list |
map | A key-value object. | map |
Temporal types
| Type | Meaning |
|---|
instant | A point in time. |
date | A calendar date. |
time | A wall-clock time. |
duration | A length of time. |
interval | A span between two instants. |
These are constructed and read through the time namespace.
See Temporal types for construction, properties, and the on
method.
Schema constructs
These appear in schema definitions to compose other types:
| Form | Meaning |
|---|
enum ["a", "b"] | One of a fixed set of strings. |
<Schema> | A reference to another schema, a foreign-key relation when the target is persistent. |
list of <Schema> | A typed list of another schema. |