# channelsOf() function · @imqueue/pg-cache

Source: https://imqueue.org/api/pg-cache/latest/pg-cache.channelsof/
Published: 2026-08-04
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-cache 5.0.6 — generated reference, not hand-written

Retrieves table names as channels from the given model and filter them by a given fields map, if passed. Returns result as list of table names.

**Signature:**

```typescript
export declare function channelsOf(model: typeof Model, fields?: any, tables?: string[]): string[];
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| model | typeof Model | sequelize-style model whose table name and associations are read to derive the channels |
| fields | any | _(Optional)_ fields the cached method depends on; an association field pulls in that association's table as well |
| tables | string\[\] | _(Optional)_ extra table names to watch that the model does not reach |


**Returns:**

string\[\]

