@keyvhq/postgres
TypeScript icon, indicating that this package has built-in type declarations

2.1.6 • Public • Published

@keyvhq/postgres keyv

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

Package Sidebar

Install

npm i @keyvhq/postgres

Homepage

keyv.js.org

Weekly Downloads

63

Version

2.1.6

License

MIT

Unpacked Size

5.43 kB

Total Files

5

Last publish

Collaborators

  • kikobeats
  • jytesh