# Repository interface · @imqueue/pg-prisma

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

The CRUD surface exposed for one model.

**Signature:**

```typescript
export interface Repository<Entity = unknown> 
```

## Remarks

`Entity` is the model's own row type, which the generated `Repositories` supplies — `Repository<Shape>` — so a call site reads a shape without naming one. A read that projects something narrower still says so: `single<{ id: string }>({ select: { id: true } })`.

## Methods


| Method | Description |
| --- | --- |
| [count(args)](https://imqueue.org/api/pg-prisma/latest/pg-prisma.repository.count/) | How many rows match the filter. |
| [create(args)](https://imqueue.org/api/pg-prisma/latest/pg-prisma.repository.create/) | Insert a row and return it. |
| [createBulk(args)](https://imqueue.org/api/pg-prisma/latest/pg-prisma.repository.createbulk/) | Insert many rows in one statement, and return them. |
| [list(args)](https://imqueue.org/api/pg-prisma/latest/pg-prisma.repository.list/) | A page of rows matching the filter. |
| [removeBulk(args)](https://imqueue.org/api/pg-prisma/latest/pg-prisma.repository.removebulk/) | Delete every row matching the filter. |
| [single(args)](https://imqueue.org/api/pg-prisma/latest/pg-prisma.repository.single/) | The first row matching the filter, or null. |
| [update(args)](https://imqueue.org/api/pg-prisma/latest/pg-prisma.repository.update/) | Update a row by id and return it. |
| [updateBulk(args)](https://imqueue.org/api/pg-prisma/latest/pg-prisma.repository.updatebulk/) | Apply the same change to every row matching the filter. |
| [upsert(args)](https://imqueue.org/api/pg-prisma/latest/pg-prisma.repository.upsert/) | Insert a row, or update the one already holding its key. |

