Class

FabricClientRepository

FabricClientRepository(adapteropt, clazzopt) → {void}

Constructor

# new FabricClientRepository(adapteropt, clazzopt) → {void}

Extends the generic Repository to prepare context and arguments for CRUD operations executed via a Fabric client Adapter, wiring RepositoryFlags and Fabric-specific overrides.

Repository implementation for Fabric client operations

sequenceDiagram participant App participant Repo as FabricClientRepository participant Adapter App->>Repo: create(model) Repo->>Repo: createPrefix(model, ...args) Repo->>Adapter: create(table, id, model, flags) Adapter-->>Repo: result Repo-->>App: model
Parameters:
Name Type Attributes Description
adapter Adapter.<any, MangoQuery, FabricFlags, Context.<FabricFlags>> <optional>

Optional adapter instance used to execute operations

clazz Constructor.<M> <optional>

Optional model constructor used by the repository

View Source client/FabricClientRepository.ts, line 5

void
Example
import { Repository } from "@decaf-ts/core";
import { FabricClientRepository } from "@decaf-ts/for-fabric";

class User extends Model { id!: string; name!: string; }
const repo = new FabricClientRepository<User>();
const created = await repo.create(new User({ id: "1", name: "Alice" }));
const loaded = await repo.read("1");