keyv-mssql

1.0.3 • Public • Published

MSSQL storage adapter for Keyv

Usage

Install keyv and keyv-mssql

npm install --save keyv keyv-mssql

Then Create a new Keyv instance, passing an instanciated KeyvMssql object as the store

const Keyv = require("keyv");
const KeyvMssql = require("keyv-mssql");
 
const store = new KeyvMssql({
  connection: {
    user: "SA",
    password: "Password1",
    host: "localhost",
    database: "TestDB"
  }
});
const keyv = new Keyv({ store: store });

You can specify a custom table with the table option, the primary key size with keySize, and whether or not to use null as default with useNullAsDefault.

e.g:

const store = new KeyvMssql({
  connection: {
    user: "SA",
    password: "Password1",
    host: "localhost",
    database: "TestDB"
  },
  table: "keyv",
  useNullAsDefault: true,
  keySize: 255
});

Package Sidebar

Install

npm i keyv-mssql

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

9.54 kB

Total Files

7

Last publish

Collaborators

  • pmorgan3