Skip to content

@codesoul-co/hypha-adapters-local / projection-store

Using this module

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

Import from the package entrypoint

ts
import {
  SQLiteProjectionStore,
} from '@codesoul-co/hypha-adapters-local';

import type {
  SQLiteProjectionStoreOptions,
} from '@codesoul-co/hypha-adapters-local';

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
SQLiteProjectionStoreclassnew SQLiteProjectionStore<TState = unknown>(options: SQLiteProjectionStoreOptions): SQLiteProjectionStore<TState>SQLite Projection Store class with 5 public constructor or member entries; its exact declarations are listed below.
SQLiteProjectionStoreOptionsinterfaceinterface SQLiteProjectionStoreOptionsSQLite Projection Store Options interface with 2 public fields or methods.

SQLiteProjectionStore

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

  • Kind: class
  • Import: import { SQLiteProjectionStore } from '@codesoul-co/hypha-adapters-local';
  • Source module: projection-store

Declaration

text
export declare class SQLiteProjectionStore<TState = unknown> implements ProjectionStore<TState> {
    constructor(options: SQLiteProjectionStoreOptions);
    get(projectionId: string, key: string): Promise<ProjectionRecord<TState> | null>;
    put(record: ProjectionRecord<TState>, expectedRevision?: number): Promise<void>;
    delete(projectionId: string, key: string): Promise<void>;
    close(): void;
}

Public members

MemberKindSignatureDescription
closemethodclose(): voidPublic method; parameters and return type are shown in the signature.
constructorconstructor<TState = unknown>(options: SQLiteProjectionStoreOptions): SQLiteProjectionStore<TState>Creates an instance of this class.
deletemethoddelete(projectionId: string, key: string): Promise<void>Public method; parameters and return type are shown in the signature.
getmethodget(projectionId: string, key: string): Promise<ProjectionRecord<TState> | null>Public method; parameters and return type are shown in the signature.
putmethodput(record: ProjectionRecord<TState>, expectedRevision?: number): Promise<void>Public method; parameters and return type are shown in the signature.

SQLiteProjectionStoreOptions

SQLite Projection Store Options interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { SQLiteProjectionStoreOptions } from '@codesoul-co/hypha-adapters-local';
  • Source module: projection-store

Declaration

text
export interface SQLiteProjectionStoreOptions {
    filename: string;
    now?: () => string;
}

Contract members

MemberKindSignatureDescription
filenamepropertyfilename: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.