vlocode-project - v1.40.0-beta-4
    Preparing search index...

    Class QueryCache

    Index

    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

      • OptionalobjectType: 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

      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