Hierarchy

  • QueryCache

Constructors

Properties

deepCloneResults: boolean = false
entries: Map<string, QueryCacheEntry> = ...
immutableResults: boolean = false

Methods

  • Delete all cached entries for all or just the specified object type

    Parameters

    • Optional objectType: string

      Object type to clear the cache for

    Returns void

  • Get the records/result associated to the specified SOQL or execute the query.

    Returns a shallow copy of the cached result so that the caller can modify the result without affecting the cache.

    Type Parameters

    • T

    Parameters

    • soql: string

      SOQL query

    Returns undefined | T[] | Promise<T[]>

    Promise of the array pointing to the records retrieved or undefined if the query is not cached

  • Get the records/result associated to the specified SOQL or execute the query.

    Returns a shallow copy of the cached result so that the caller can modify the result without affecting the cache.

    Type Parameters

    • T

    Parameters

    • soql: string

      SOQL query

    • records: (() => Promise<T[]>)

      executor to retrieve the records

        • (): Promise<T[]>
        • Returns Promise<T[]>

    Returns T[] | Promise<T[]>

    Promise of the array pointing to the records retrieved

  • Calculate a unique hash for the specified query by sorting the query fields, order and group-by clauses to create a unique key that represents the query being executed best

    Parameters

    Returns string

    unique SHA1 hash of the query that can be used as cache-entry