KeyvStore
Keyv-based cache store implementation.
Remarks
Not recommended for production environments with high query volumes. Consider using Redis or Upstash for production deployments.
Example
import { KeyvStore } from "@baeta/extension-cache-keyv";
import Keyv from "keyv";
const keyv = new Keyv();
const store = new KeyvStore(keyv);
// Use with cache extension
const cacheExt = cacheExtension(store, {
ttl: 3600,
});
Extends
Constructors
Constructor
new KeyvStore(
keyv):KeyvStore
Parameters
| Parameter | Type |
|---|---|
|
|
|
Returns
KeyvStore
Overrides
Properties
| Property | Modifier | Type |
|---|---|---|
|
|
|
Methods
createStoreAdapter()
createStoreAdapter<
T>(serializer,options,type,hash):StoreAdapter<T>
Creates a new store adapter for a specific type
Type Parameters
| Type Parameter |
|---|
|
|
Parameters
| Parameter | Type | Description |
|---|---|---|
|
|
Serializer instance | |
|
|
|
Store configuration options |
|
|
|
Type name for the cached items |
|
|
|
Unique hash for the type |
Returns
StoreAdapter<T>