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 |
|---|---|---|---|
|
string |
PostgreSQL database connection string | ||
|
string |
(Optional) Redis cache key prefix to use. If not specified, decorated service class name will be used as prefix by default. | ||
|
boolean |
(Optional) Pass false, if database channel event should not be published by service to connected clients. By default is enabled = true. | ||
|
(Optional) Redis connection options | |||
|
RedisCache |
(Optional) Initialized redis cache instance. One of redis option or this redisCache option is required to be provided | ||
|
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.