Skip to content

@codesoul-co/hypha-serving-cache / stores/sqlite-store

Using this module

Use the Sqlite store module for persisting and reading data at this boundary. It exports 1 class, 1 interface.

Import from the package entrypoint

ts
import {
  SQLiteCacheStore,
} from '@codesoul-co/hypha-serving-cache';

import type {
  SQLiteCacheStoreOptions,
} from '@codesoul-co/hypha-serving-cache';

Usage patterns

  • Use the 1 type/interface export as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
SQLiteCacheStoreclassnew SQLiteCacheStore(options: SQLiteCacheStoreOptions): SQLiteCacheStoreSQLite Cache Store class with 6 public constructor or member entries; its exact declarations are listed below.
SQLiteCacheStoreOptionsinterfaceinterface SQLiteCacheStoreOptionsSQLite Cache Store Options interface with 3 public fields or methods.

SQLiteCacheStore

SQLite Cache Store class with 6 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { SQLiteCacheStore } from '@codesoul-co/hypha-serving-cache';
  • Source module: stores/sqlite-store

Declaration

text
export declare class SQLiteCacheStore implements CacheStore {
    constructor(options: SQLiteCacheStoreOptions);
    get<T>(key: string): Promise<CacheEntry<T> | null>;
    set<T>(key: string, entry: CacheEntry<T>): Promise<void>;
    delete(key: string): Promise<void>;
    clear(): Promise<void>;
    touch(key: string, timestamp: number): Promise<void>;
}

Public members

MemberKindSignatureDescription
clearmethodclear(): Promise<void>Public method; parameters and return type are shown in the signature.
constructorconstructor(options: SQLiteCacheStoreOptions): SQLiteCacheStoreCreates an instance of this class.
deletemethoddelete(key: string): Promise<void>Public method; parameters and return type are shown in the signature.
getmethodget<T>(key: string): Promise<CacheEntry<T> | null>Public method; parameters and return type are shown in the signature.
setmethodset<T>(key: string, entry: CacheEntry<T>): Promise<void>Public method; parameters and return type are shown in the signature.
touchmethodtouch(key: string, timestamp: number): Promise<void>Public method; parameters and return type are shown in the signature.

SQLiteCacheStoreOptions

SQLite Cache Store Options interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { SQLiteCacheStoreOptions } from '@codesoul-co/hypha-serving-cache';
  • Source module: stores/sqlite-store

Declaration

text
export interface SQLiteCacheStoreOptions {
    filename: string;
    required?: boolean;
    maxEntries?: number;
}

Contract members

MemberKindSignatureDescription
filenamepropertyfilename: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
maxEntriespropertymaxEntries?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
requiredpropertyrequired?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.