PgCacheOptions interface

Options for the PgCache() class decorator: where PostgreSQL and redis live, and how the change-notify triggers behave.

Exactly one of redis or redisCache must be supplied — redis to let the decorator build its own connection, redisCache to reuse one the service already owns.

Signature:

export interface PgCacheOptions 

Properties

Property

Modifiers

Type

Description

postgres

string

PostgreSQL database connection string

prefix?

string

(Optional) Redis cache key prefix to use. If not specified, decorated service class name will be used as prefix by default.

publish?

boolean

(Optional) Pass false, if database channel event should not be published by service to connected clients. By default is enabled = true.

redis?

(Optional) Redis connection options

redisCache?

RedisCache

(Optional) Initialized redis cache instance. One of redis option or this redisCache option is required to be provided

triggerDefinition?

string

(Optional) SQL definition of the trigger function, in case default which is used by this lib is not satisfying for some reason. Expected string starting with 'create function post_change_notify_trigger() returns trigger' or will fall back to a default trigger definition. Spaces and case is ignored, 'or replace statement is allowed', if needed.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.