# stamp() function · @imqueue/pg-prisma

Source: https://imqueue.org/api/pg-prisma/latest/pg-prisma.stamp/
Published: 2026-08-28
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-prisma 2.0.0 — generated reference, not hand-written

Build the middleware that stamps authorship and turns deletes into stamps.

**Signature:**

```typescript
export declare function stamp(input: StampOptions): SqlMiddleware;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| input | [StampOptions](https://imqueue.org/api/pg-prisma/latest/pg-prisma.stampoptions/) | Per-table columns and the actor resolver. |


**Returns:**

SqlMiddleware

Middleware for the `middleware` array of the `postgres()` factory.

## Remarks

One middleware rather than two because the two halves are inseparable: a soft delete only exists as an `update` \*\*because\*\* this rewrote the `delete` into one, and only this knows that the update it is stamping is a deletion. Split across two middlewares — as the Prisma 7 extensions were — the second has to infer the deletion from the assignments, and the pair has to be ordered correctly by every caller, with `deletedBy` silently never written when it is not. Neither hazard can be expressed here.

Reads are filtered across the \*\*whole statement\*\*, not just its outermost `from`, so a soft-deleted row reached through a relation is excluded too.

A null actor stamps null rather than skipping the column, which is what makes a system write distinguishable from one whose author was never recorded.

