# PgPubSub.once() method · @imqueue/pg-pubsub

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

Sets `'connect'` event handler, which fired only one single time

**Signature:**

```typescript
once(event: 'connect', listener: typeof connect): this;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| event | 'connect' | `'connect'` — a PostgreSQL connection has been established |
| listener | typeof connect | handler invoked when a PostgreSQL connection has been established. Fires at most once. |


**Returns:**

this

