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

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

Rewrites `<column>Range` filter properties onto the columns they belong to.

**Signature:**

```typescript
export function withRangeFilters(filter: any): any;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| filter | any | Filter to rewrite in place. |


**Returns:**

any

The same filter, with ranges moved onto their columns.

## Remarks

The convention that lets a range be filtered over RPC: a caller sends `durationRange: { start, end }` and this moves it to `duration`, where [query.toWhereOptions()](https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.query.towhereoptions/) turns it into a `BETWEEN`. Recognition is strict — the property name must end in `Range` and the value must have exactly the keys `start` and `end`, in either order. Anything else is left untouched and filtered as an ordinary value, and nested objects are walked so a range on a related model works too.

Sending both `duration` and `durationRange` throws rather than choosing one.

MUTATES and returns the filter it is given.

