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

    Class QueryService

    Index

    Constructors

    Properties

    cache: { data: QueryCache; tooling: QueryCache } = ...
    connectionProvider: SalesforceConnectionProvider
    logger: Logger
    nsService: NamespaceService
    queryCacheDefault: boolean = false
    queryCacheEnabled: boolean = true
    numberFormat: NumberFormat = ...

    Number formatter for Salesforce numbers used by the query service. Change this to change the default number formatting behavior.

    Methods

    • Query salesforce for a record

      Type Parameters

      • T extends object = object
      • K extends PropertyKey = keyof T

      Parameters

      • query: string

        Query string

      • OptionaluseCache: boolean

        Store the query in the internal query cache or retrieve the cached version of the response if it exists

      • OptionalcancelToken: CancellationToken

      Returns Promise<QueryResult<T, K>[]>

    • Query salesforce for a record using the tooling API

      Type Parameters

      • T extends object = object
      • K extends PropertyKey = keyof T

      Parameters

      • query: string

        Query string

      • OptionaluseCache: boolean

        Store the query in the internal query cache or retrieve the cached version of the response if it exists

      • OptionalcancelToken: CancellationToken

      Returns Promise<QueryResult<T, K>[]>

    • Sets the query cache options. When the query cache is enabled, the query results are stored in memory and reused when the same query is executed again. When changing cache state the current cache is cleared.

      Parameters

      • options: { default?: boolean; enabled: boolean }

        The query cache options.

        • Optionaldefault?: boolean

          Indicates what the default behavior should be when the useCache paramter is not explicitly set by the caller.

        • enabled: boolean

          Indicates whether the query cache is enabled.

      Returns this

      The current instance of the QueryService.

    • Format the value of a field to match the Salesforce object schema value so it can be inserted or uploaded

      Parameters

      • value: any

        The value to format

      • field: { type: FieldType }

        Field metadata describing the field type

      • options: { escapeStrings: boolean; wrapStrings: boolean } = ...

        Extra options such as wrapping and escaping; both default to true

      Returns string