Caching layer for node-postgres (pg) that automatically caches SELECT query results in Redis. Version 0.1.0, experimental. Provides multiple hash types (farmhash32, farmhash64, blake2b512, full) for cache keys. Falls back to Postgres on Redis failure. Requires pg/pg-pool and redis/ioredis as peer dependencies. Distinct from other caching libraries by offering configurable hash strategies and per-query custom hashing.
npm install postgres-redisNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create PostgresRedis instance with Pool, Redis client, and perform a cached query.
Manually delete/update cache keys or set short TTL.
Use HashTypes.blake2b512 or HashTypes.full for large query sets.
Use async-redis package with PostgresRedisAsync, or use callbacks with PostgresRedis.
Use PostgresRedisAsync or wrap in util.promisify.
Monitor Redis health separately; implement logging on fallback.
Use postgresRedisAsync.queryAsync instead of .query.
Ensure REDIS_URL or createClient options are correct.
Pass callback function to query or use PostgresRedisAsync.