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

NamespaceWhat it doesPage
dbRelational database access and query pipelines.db
docDocument database access and aggregation pipelines.doc
cacheShort-lived key-value storage with TTLs.cache

Messaging

NamespaceWhat it doesPage
queuePoint-to-point work queues.queue
topicPublish-subscribe topics.topic

Integration

NamespaceWhat it doesPage
http_clientOutbound HTTP requests to other services.http_client

Utilities

NamespaceWhat it doesPage
timeInstants, dates, durations, and the clock.time
mathNumeric helpers (rounding, clamping, min and max).math
jsonParse and serialize JSON.json
base64Encode and decode base64.base64
uuidGenerate UUIDs.uuid
logStructured logging.log
fsRead and write files.fs
featureRead 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.