1.0.15 • Published 7 years ago
keyv-postgres-shrink v1.0.15
keyv-postgres-shrink
Fork of the PostgreSQL storage adapter for Keyv. Supports removing expired data via a shrink
function.
Requires Postgres 9.5 or newer for ON CONFLICT
support to allow performant upserts. Why?
Install
npm install --save keyv keyv-postgres-shrink
Usage
const Keyv = require('keyv');
const KeyvStorageAdapter = require('keyv-postgres-shrink');
const storage = new KeyvStorageAdapter({
uri: 'postgresql://user:pass@localhost:5432/dbname',
table: 'myappcache'
});
const keyv = new Keyv({
store: storage,
namespace: 'myapp'
});
keyv.on('error', handleConnectionError);
License
MIT © MySidesTheyAreGone
MIT © Luke Childs