PostgreSQL storage adapter for Keyv.
Requires Postgres 9.5 or newer for ON CONFLICT
support to allow performant upserts. Why?
npm install --save @keyvhq/core @keyvhq/postgres
const KeyvPostgres = require('@keyvhq/postgres')
const Keyv = require('@keyvhq/core')
const keyv = new Keyv({
store: new KeyvPostgres({
uri: 'postgresql://user:pass@localhost:5432/dbname',
ssl: {
rejectUnauthorized: false
}
})
})
You can specify the table
option:
const KeyvPostgres = require('@keyvhq/postgres')
const Keyv = require('@keyvhq/core')
const keyv = new Keyv({
store: new KeyvPostgres('postgresql://user:pass@localhost:5432/dbname', {
table: 'cache'
})
})
@keyvhq/postgres © Luke Childs, released under the MIT License.
Maintained by Microlink with help from contributors.
microlink.io · GitHub microlinkhq · X @microlinkhq