# query.pureFields() function · @imqueue/pg-sequelize

Source: https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.query.purefields/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-sequelize 4.2.0 — generated reference, not hand-written

Narrows a requested fields map to the model's own columns.

**Signature:**

```typescript
export function pureFields(model: typeof BaseModel, fields: any): string[] | true;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| model | typeof [BaseModel](https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.basemodel/) | Model to narrow against. |
| fields | any | Requested fields map, or a falsy value for "everything". |


**Returns:**

string\[\] \| true

The surviving column names, or `true` meaning no restriction.

## Remarks

Relations and unknown names are dropped, and the primary keys are then added back whether or not they were asked for — a deliberate trade so domain logic always has a key to work with, at the cost of returning a column the caller did not request.

