Repository interface
The CRUD surface exposed for one model.
Signature:
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 |
|---|---|
|
How many rows match the filter. | |
|
Insert a row and return it. | |
|
Insert many rows in one statement, and return them. | |
|
A page of rows matching the filter. | |
|
Delete every row matching the filter. | |
|
The first row matching the filter, or null. | |
|
Update a row by id and return it. | |
|
Apply the same change to every row matching the filter. | |
|
Insert a row, or update the one already holding its key. |
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.