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
options?
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
Returns
Promise<string[]>
Implementation of
Methods
all()
> all(): Promise<OutboxEntry[]>
Defined in: events-prisma/src/index.ts:268
Returns
Promise<OutboxEntry[]>
Implementation of
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?
Returns
Promise<OutboxEntry>
Implementation of
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?
Returns
Promise<void>
Implementation of
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
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[]>