storageFromEnv
function storageFromEnv<S>(options): Promise<S>;Defined in: src/cli/index.ts:479
Build a role’s storage from env (au/en’s allow-list loader, generic over the
product’s roles). Unknown drivers fail instead of silently using file.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
S |
unknown |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
StorageFromEnvOptions<S> |
Returns
Section titled “Returns”Promise<S>
Example
Section titled “Example”const queue = await storageFromEnv<WebhooksStorage>({ role: { name: "QUEUE", defaults: { prefix: "xtandard:webhooks:queue", pgTable: "xtandard_webhooks_queue", mongoDb: "xtandard_webhooks", mongoCollection: "webhooks_queue", sqlitePath: "./.webhooks/queue.sqlite", sqliteTable: "xtandard_webhooks", libsqlUrl: "file:./.webhooks/queue.db", fileDir: "./.webhooks/queue" }, },});