# OrderByInput class · @imqueue/pg-sequelize

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

Which columns to order by, and in which direction.

**Signature:**

```typescript
export declare class OrderByInput 
```

## Remarks

Keyed by column name; `query.toOrderOptions` turns it into Sequelize's `order` array, preserving the key order of the object, so the first key is the primary sort.

Direction values are coerced rather than validated: anything that does not read as `desc`, case-insensitively, becomes ascending. That is deliberate — the value arrives from a remote caller and ends up in SQL, so an unrecognised direction has to become a safe default rather than being passed through. It does mean a typo silently sorts the other way.

Column names are NOT coerced, and they reach the query as given.

## Example


```typescript
const orderBy: OrderByInput = { type: OrderDirection.asc, createdAt: OrderDirection.desc };
```

