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

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

Split a wire projection into its scalar and relation halves.

**Signature:**

```typescript
export declare function toProjection(relations: RelationMap, model: string, select: Select | undefined): Projection | undefined;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| relations | [RelationMap](https://imqueue.org/api/pg-prisma/latest/pg-prisma.relationmap/) | Relations per model, from `deriveDataLayer`. |
| model | string | The model the projection is written against. |
| select | [Select](https://imqueue.org/api/pg-prisma/latest/pg-prisma.select/) \| undefined | The projection, or undefined for the whole row. |


**Returns:**

[Projection](https://imqueue.org/api/pg-prisma/latest/pg-prisma.projection/) \| undefined

The split projection, or undefined when nothing was asked for.

## Remarks

Prisma Next separates the two — `.select(...)` names scalar fields and `.include(name, branch)` pulls a relation — where the wire shape nests them in one object. Splitting here keeps every caller from walking it again.

