Data Types
Choose correct types when modeling tables and declaring client variables, page variables, and action parameters.
Momen uses PostgreSQL underneath.
Basic types
| Type | PostgreSQL | Limits | Use |
|---|---|---|---|
| Text | text | up to ~1 GB | Names, emails, HTML strings |
| Integer | integer | 32-bit signed | Counts, IDs, status codes |
| Decimal | numeric | high precision | Prices, money, billing |
| Boolean | boolean | true / false | Flags (is_vip, toggles) |
⚠️
JavaScript and many APIs use float doubles. DB Decimal is exact; mixing float math in custom code can introduce tiny errors before write-back.
Date and time
| Type | Format | Use |
|---|---|---|
| DateTime (with timezone) | YYYY-MM-DDTHH:mm:ss.sssZ | Order paid at, logs, appointments |
| Date | YYYY-MM-DD | Birthdays, contract dates (no time) |
| Time (with timezone) | HH:mm:ss.sssZ | Daily opening hours |
Media types
Files upload to object storage; the database stores the URL.
| Type | Stored as | Use |
|---|---|---|
| Image | URL | Avatars, product images |
| Video | URL | Clips, courses |
| File | URL | PDF, Office docs, archives |
Geo and JSONB
Geo point
[longitude, latitude] — distance formulas for “nearby store” sort and filter.
JSONB
Flexible JSON with GIN indexing — webhook payloads, variant attributes ({"color":"red","size":"XL"}), complex page variable blobs.
Last updated on