Class EntityDataManager<TFields>

A data manager is responsible for orchestrating multiple sources of entity data including local caches, EntityCacheAdapter, and EntityDatabaseAdapter.

It is also responsible for invalidating all sources of data when mutated using EntityMutator.

Type Parameters

  • TFields extends Record<string, any>

Constructors

Methods

  • Load many objects where fieldName is one of fieldValues.

    Type Parameters

    • N extends string | number | symbol

    Parameters

    • queryContext: EntityQueryContext

      query context in which to perform the load

    • fieldName: N

      object field being queried

    • fieldValues: readonly NonNullable<TFields[N]>[]

      fieldName field values being queried

    Returns Promise<ReadonlyMap<NonNullable<TFields[N]>, readonly Readonly<TFields>[]>>

    map from fieldValue to objects that match the query for that fieldValue

  • Loads many objects matching the conjunction of where clauses constructed from specified field equality operands.

    Type Parameters

    • N extends string | number | symbol

    Parameters

    Returns Promise<readonly Readonly<TFields>[]>

    array of objects matching the query

  • Loads many objects matching the raw WHERE clause.

    Parameters

    • queryContext: EntityQueryContext

      query context in which to perform the load

    • rawWhereClause: string

      parameterized SQL WHERE clause with positional binding placeholders or named binding placeholders

    • bindings: object | any[]

      array of positional bindings or object of named bindings

    • querySelectionModifiers: QuerySelectionModifiersWithOrderByRaw<TFields>

      limit, offset, orderBy, and orderByRaw for the query

    Returns Promise<readonly Readonly<TFields>[]>

    array of objects matching the query