Skip to content

@codesoul-co/hypha-adapters-local / sqlite-artifact-record-repository

Using this module

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

Import from the package entrypoint

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

import type {
  SQLiteArtifactRecordRepositoryOptions,
} 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
SQLiteArtifactRecordRepositoryclassnew SQLiteArtifactRecordRepository(options: SQLiteArtifactRecordRepositoryOptions): SQLiteArtifactRecordRepositorySQLite Artifact Record Repository class with 14 public constructor or member entries; its exact declarations are listed below.
SQLiteArtifactRecordRepositoryOptionsinterfaceinterface SQLiteArtifactRecordRepositoryOptionsSQLite Artifact Record Repository Options interface with 5 public fields or methods.

SQLiteArtifactRecordRepository

SQLite Artifact Record Repository class with 14 public constructor or member entries; its exact declarations are listed below.

Declaration

text
export declare class SQLiteArtifactRecordRepository implements ArtifactRecordRepository {
    readonly id: string;
    readonly filename: string;
    constructor(options: SQLiteArtifactRecordRepositoryOptions);
    get(artifactId: string, versionId?: string): Promise<StoredArtifactRecord | null>;
    getByVersionId(versionId: string): Promise<StoredArtifactRecord | null>;
    list(): Promise<StoredArtifactRecord[]>;
    findIdempotency(operationId: string, idempotencyKey: string): Promise<StoredArtifactRecord | null>;
    commit(request: ArtifactRecordCommitRequest): Promise<void>;
    listGarbageCollectionCandidates(request: ArtifactGarbageCollectionScanRequest): Promise<ArtifactGarbageCollectionCandidate[]>;
    claimGarbageCollection(request: ArtifactGarbageCollectionClaimRequest): Promise<boolean>;
    completeGarbageCollection(claimId: string, completedAt: string): Promise<void>;
    releaseGarbageCollection(claimId: string): Promise<void>;
    health(): Promise<ProviderHealth>;
    close(): Promise<void>;
}

Public members

MemberKindSignatureDescription
claimGarbageCollectionmethodclaimGarbageCollection(request: ArtifactGarbageCollectionClaimRequest): Promise<boolean>Public method; parameters and return type are shown in the signature.
closemethodclose(): Promise<void>Public method; parameters and return type are shown in the signature.
commitmethodcommit(request: ArtifactRecordCommitRequest): Promise<void>Public method; parameters and return type are shown in the signature.
completeGarbageCollectionmethodcompleteGarbageCollection(claimId: string, completedAt: string): Promise<void>Public method; parameters and return type are shown in the signature.
constructorconstructor(options: SQLiteArtifactRecordRepositoryOptions): SQLiteArtifactRecordRepositoryCreates an instance of this class.
filenamepropertyreadonly filename: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
findIdempotencymethodfindIdempotency(operationId: string, idempotencyKey: string): Promise<StoredArtifactRecord | null>Public method; parameters and return type are shown in the signature.
getmethodget(artifactId: string, versionId?: string): Promise<StoredArtifactRecord | null>Public method; parameters and return type are shown in the signature.
getByVersionIdmethodgetByVersionId(versionId: string): Promise<StoredArtifactRecord | null>Public method; parameters and return type are shown in the signature.
healthmethodhealth(): Promise<ProviderHealth>Public method; parameters and return type are shown in the signature.
idpropertyreadonly id: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
listmethodlist(): Promise<StoredArtifactRecord[]>Public method; parameters and return type are shown in the signature.
listGarbageCollectionCandidatesmethodlistGarbageCollectionCandidates(request: ArtifactGarbageCollectionScanRequest): Promise<ArtifactGarbageCollectionCandidate[]>Public method; parameters and return type are shown in the signature.
releaseGarbageCollectionmethodreleaseGarbageCollection(claimId: string): Promise<void>Public method; parameters and return type are shown in the signature.

SQLiteArtifactRecordRepositoryOptions

SQLite Artifact Record Repository Options interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { SQLiteArtifactRecordRepositoryOptions } from '@codesoul-co/hypha-adapters-local';
  • Source module: sqlite-artifact-record-repository

Declaration

text
export interface SQLiteArtifactRecordRepositoryOptions {
    rootPath: string;
    filename?: string;
    id?: string;
    busyTimeoutMs?: number;
    now?: () => string;
}

Contract members

MemberKindSignatureDescription
busyTimeoutMspropertybusyTimeoutMs?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
filenamepropertyfilename?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid?: 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.
rootPathpropertyrootPath: stringPublic property; its type, readonly modifier and optionality are shown in the signature.