Skip to content

basalt / events-prisma/src / PrismaOutboxStore

Class: PrismaOutboxStore ​

Defined in: events-prisma/src/index.ts:138

Implements ​

Constructors ​

Constructor ​

> new PrismaOutboxStore(client, options?): PrismaOutboxStore

Defined in: events-prisma/src/index.ts:147

Parameters ​

client ​

PrismaEventsClient

options? ​

PrismaOutboxStoreOptions = {}

Returns ​

PrismaOutboxStore

Properties ​

claim? ​

> readonly optional claim?: (ids, options) => Promise<string[]>

Defined in: events-prisma/src/index.ts:143

Present only with { claim: true } — the relay checks for it, so a store whose schema lacks the lock columns is never asked to write them.

Parameters ​

ids ​

string[]

options ​

OutboxClaimOptions

Returns ​

Promise<string[]>

Implementation of ​

OutboxStore.claim

Methods ​

all() ​

> all(): Promise<OutboxEntry[]>

Defined in: events-prisma/src/index.ts:268

Returns ​

Promise<OutboxEntry[]>

Implementation of ​

OutboxStore.all


enqueue() ​

> enqueue(input, options?): Promise<OutboxEntry>

Defined in: events-prisma/src/index.ts:161

Writes the entry. Pass { tx } — the client Prisma hands to $transaction(async (tx) => …) — to write it in the same transaction as your state change: a rollback removes both.

Parameters ​

input ​
createdAt ​

number

event ​

string

id? ​

string

payload ​

unknown

tenantId? ​

string

options? ​
tx? ​

PrismaOutboxTx

Returns ​

Promise<OutboxEntry>

Implementation of ​

OutboxStore.enqueue


markFailed() ​

> markFailed(id, error, options?): Promise<void>

Defined in: events-prisma/src/index.ts:252

Records a failed attempt (and releases its claim, or holds it until options.retryAt).

Parameters ​

id ​

string

error ​

string

options? ​

OutboxMarkFailedOptions = {}

Returns ​

Promise<void>

Implementation of ​

OutboxStore.markFailed


markPublished() ​

> markPublished(id, at_): Promise<void>

Defined in: events-prisma/src/index.ts:246

Marks an entry delivered (and releases its claim).

Parameters ​

id ​

string

at_ ​

number

Returns ​

Promise<void>

Implementation of ​

OutboxStore.markPublished


pending() ​

> pending(limit, maxAttempts, filter?): Promise<OutboxEntry[]>

Defined in: events-prisma/src/index.ts:201

Unpublished entries below the attempt ceiling (minus filter's tenants), oldest first.

Parameters ​

limit ​

number

maxAttempts ​

number

filter? ​

OutboxPendingFilter = {}

Returns ​

Promise<OutboxEntry[]>

Implementation of ​

OutboxStore.pending

Released under the MIT License.