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

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

Turns a serialized order into Sequelize's `order` option.

**Signature:**

```typescript
export function toOrderOptions<_T>(orderBy?: OrderByInput): FindOptions;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| orderBy | [OrderByInput](https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.orderbyinput/) | _(Optional)_ Property-to-direction map from the caller. |


**Returns:**

FindOptions

Options carrying `order`, or empty options.

## Remarks

One entry per property, in the order the object lists them, so the caller controls precedence. Directions are normalised rather than trusted — anything that does not read as descending becomes ascending, which is what keeps a value off the wire out of the statement. An empty or absent order yields no `order` at all rather than an empty one.

