Member Junction
    Preparing search index...

    Class QueryResultEnricherBaseAbstract

    Abstract seam for a post-query row enricher. Concrete enrichers live OUTSIDE MJCore (e.g. an ML-scoring enricher in Predictive Studio) and register themselves on the MJGlobal ClassFactory via @RegisterClass(QueryResultEnricherBase, '<key>'). RunQuery resolves the registered enricher by key and awaits EnrichResults just before returning, appending whatever columns the enricher produces.

    Enrichers MUST be resilient: an enrichment failure must never break the underlying query. RunQuery wraps the call in a try/catch and falls back to the original rows, but enrichers should also degrade gracefully (return the input rows unchanged) rather than throwing for recoverable conditions.

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Enrich (append columns to) the query result rows. Implementations should return a row array of the same length and order, mutating/cloning each row to add their derived column(s). On any unrecoverable condition they may throw — RunQuery's guard will log and fall back to the original rows.

      Parameters

      • opts: {
            config: Record<string, unknown>;
            contextUser?: UserInfo;
            provider?: IMetadataProvider;
            query?: QueryInfo;
            rows: Record<string, unknown>[];
        }
        • config: Record<string, unknown>

          the enricher-specific config from RunQueryEnrichment.Config

        • OptionalcontextUser?: UserInfo

          the request user — required server-side for isolation/audit

        • Optionalprovider?: IMetadataProvider

          the owning provider for multi-provider-correct data access

        • Optionalquery?: QueryInfo

          the loaded query metadata, when available (lets an enricher read the query's associated entity, fields, etc.)

        • rows: Record<string, unknown>[]

          the assembled query result rows to enrich

      Returns Promise<Record<string, unknown>[]>