# Supported data types (Amazon DynamoDB)

## Writing: .NET to Amazon DynamoDB

| .NET value | Stored as |
|---|---|
| `string` | S (string); an empty key value is ARX1001 |
| `char` | S |
| a plain `enum` | refused (ARX1007): write `(int)value` or `value.ToString()`, or use a selection set |
| `int`, `long`, `short`, `byte` and the unsigned types | N (number) |
| `decimal` | N, exact up to 38 digits (more is ARX4001) |
| `double`, `float` | N; NaN and infinity are ARX4001 |
| `bool` | BOOL |
| `Guid` | S, `D` format (`5f0c…-…`) |
| `byte[]`, `ArxBytea` | B (binary) |
| `ArxJsonB` | M (map) or L (list), its JSON parsed |
| an array or a list | L, a list of the values above |
| `ArxSelectionSetValue` | its code, checked against the catalog |
| `ArxEntityReference` | the referenced id, checked against the catalog (ARX1005) |
| `null` | NULL |

## Dates and times

DynamoDB has no date type: ARX stores dates as sortable text, so a sort key or a condition on a date compares in time
order.

| .NET value | Stored as |
|---|---|
| `DateTime` (UTC) | S, `2026-11-09T10:30:00.0000000Z` (every tick kept) |
| `DateTime` (Local) | converted to UTC |
| `DateTime` (Unspecified) | taken as UTC |
| `DateTimeOffset` | its UTC instant (the offset isn't kept) |
| `DateOnly` | S, `2026-11-09` |
| `TimeOnly`, `TimeSpan` | S (`09:30:00.0000000`, `1.02:03:04`) |
| `default(DateTime)`, `default(DateTimeOffset)`, `default(DateOnly)` | refused (ARX1013): they mean "not set" |

## Reading: Amazon DynamoDB to .NET

| Stored as | Read back as |
|---|---|
| S (string) | `string`, or the preloaded type (`Guid`, `DateTime`, `DateOnly`, …) |
| N (number) | `decimal` (a `double` past decimal's range), or the preloaded type |
| BOOL | `bool` |
| B (binary) | `byte[]` |
| M (map) | `ArxJsonB` |
| L (list) | `string[]` or `decimal[]` when every element is that kind; otherwise `ArxJsonB` |
| SS, NS, BS (sets) | `string[]`, a number array, `byte[][]` |
| NULL, or no attribute | null |
| a declared lookup | `ArxEntityReference` |
