# DataPage interface · @imqueue/pg-sequelize

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

One page of results together with the size of the whole set.

**Signature:**

```typescript
export interface DataPage<T> 
```

## Remarks

The envelope a paginated service method returns, so a caller that asked for 20 rows can still render "20 of 1,340" without a second round trip. Nothing in this package produces one — it is a shape for your own service methods to declare and fill, which is why `data` is whatever you put in it rather than an array.

## Example


```typescript
@expose()
public async listReservations(
    page?: PaginationInput,
): Promise<DataPage<Reservation[]>> {
    const { rows, count } = await Reservation.findAndCountAll(
        query.toLimitOptions(page),
    );

    return { total: count, data: rows };
}
```

## Properties


| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [data](https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.datapage.data/) |  | T | The page itself. |
| [total](https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.datapage.total/) |  | number | Rows matching the query in total, ignoring the page window. |

