namespaces
Namespaces
The built-in namespaces Marreta exposes for data, messaging, integration, and utilities, one page each.
A namespace groups related operations under a name you call with dot syntax, like
db.users.find(id) or time.now(). These are the native namespaces: they are built into
the language and the runtime, with no import. The provider-backed ones (data, cache,
messaging) read their connection details from marreta.env.
For the idea behind namespaces, including the file namespaces you create yourself by
exporting tasks, see Namespaces.
Data and persistence
| Namespace | What it does | Page |
|---|
db | Relational database access and query pipelines. | db |
doc | Document database access and aggregation pipelines. | doc |
cache | Short-lived key-value storage with TTLs. | cache |
Messaging
| Namespace | What it does | Page |
|---|
queue | Point-to-point work queues. | queue |
topic | Publish-subscribe topics. | topic |
Integration
| Namespace | What it does | Page |
|---|
http_client | Outbound HTTP requests to other services. | http_client |
Utilities
| Namespace | What it does | Page |
|---|
time | Instants, dates, durations, and the clock. | time |
math | Numeric helpers (rounding, clamping, min and max). | math |
json | Parse and serialize JSON. | json |
base64 | Encode and decode base64. | base64 |
uuid | Generate UUIDs. | uuid |
log | Structured logging. | log |
fs | Read and write files. | fs |
feature | Read feature flags. | feature |
Request context (params, query, payload, message) and configuration (env) are
also addressed as namespaces, and are covered where they are used, in
Routes and the how-to guides.