@keyvhq/postgres
v2.1.6
Published
PostgreSQL storage adapter for Keyv
Downloads
151
Readme
@keyvhq/postgres
PostgreSQL storage adapter for Keyv.
Requires Postgres 9.5 or newer for ON CONFLICT
support to allow performant upserts. Why?
Install
npm install --save @keyvhq/core @keyvhq/postgres
Usage
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'
})
})
License
@keyvhq/postgres © Luke Childs, released under the MIT License. Maintained by Microlink with help from contributors.
microlink.io · GitHub microlinkhq · X @microlinkhq