Class

FabricStatement

FabricStatement(adapter, ctx) → {void}

Constructor

# new FabricStatement(adapter, ctx) → {void}

Bridges CouchDB-style queries to Fabric via the FabricContractAdapter, handling identity and primary key projection when needed.

Statement wrapper for executing Mango queries within Fabric contracts

sequenceDiagram participant App participant Statement participant Adapter participant Ledger App->>Statement: raw({ selector }) Statement->>Adapter: adapter.raw(mango, true, ctx) Adapter->>Ledger: Evaluate query Adapter-->>Statement: rows Statement-->>App: models
Parameters:
Name Type Description
adapter FabricContractAdapter

The Fabric contract adapter used for raw execution

ctx FabricContractContext

The Fabric contract context carrying stub and identity

View Source contracts/FabricContractStatement.ts, line 8

void
Example
const stmt = new FabricStatement<MyModel, MyModel[]>(adapter, ctx);
const result = await stmt.raw<MyModel[]>({ selector: { type: 'MyModel' } });