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

2.1.1 • 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 · Twitter @microlinkhq

Package Sidebar

Install

npm i @keyvhq/postgres

Homepage

keyv.js.org

Weekly Downloads

6

Version

2.1.1

License

MIT

Unpacked Size

5.44 kB

Total Files

5

Last publish

Collaborators

  • kikobeats
  • jytesh