Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pmorgan3/keyv-mssql
An MSSql adapter for keyv
https://github.com/pmorgan3/keyv-mssql
key-value keyv mssql-adapter sql-server
Last synced: 3 months ago
JSON representation
An MSSql adapter for keyv
- Host: GitHub
- URL: https://github.com/pmorgan3/keyv-mssql
- Owner: pmorgan3
- License: mit
- Created: 2019-09-06T15:37:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T01:48:56.000Z (almost 2 years ago)
- Last Synced: 2024-10-01T15:14:30.129Z (3 months ago)
- Topics: key-value, keyv, mssql-adapter, sql-server
- Language: JavaScript
- Size: 691 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# MSSQL storage adapter for [Keyv](https://github.com/lukechilds/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
```js
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:
```js
const store = new KeyvMssql({
connection: {
user: "SA",
password: "Password1",
host: "localhost",
database: "TestDB"
},
table: "keyv",
useNullAsDefault: true,
keySize: 255
});
```