Private
Readonly
dataPrivate
Readonly
entityPrivate
Readonly
entityPrivate
Readonly
entityProtected
Readonly
metricsPrivate
Readonly
privacyPrivate
Readonly
privacyPrivate
Readonly
queryPrivate
Readonly
viewerConstruct and authorize entities from fields map, returning error results for entities that fail to construct or fail to authorize.
map from an arbitrary key type to an array of entity field objects
Enforcing view on this entity loader. All loads through this view are guaranteed to be the values of successful results (or null for some loader methods), and will throw otherwise.
Load an entity where fieldName equals fieldValue, or null if no entity exists.
entity field being queried
uniqueFieldName field value being queried
entity result where uniqueFieldName equals fieldValue, or null if no entity matches the condition.
when multiple entities match the condition
Loads the first entity matching the selection constructed from the conjunction of specified operands, or null if no matching entity exists. Entities loaded using this method are not batched or cached.
This is a convenience method for loadManyByFieldEqualityConjunctionAsync. However, the
orderBy
option must be specified to define what "first" means. If ordering doesn't matter,
explicitly pass in an empty array.
list of field equality selection operand specifications
orderBy and optional offset for the query
the first entity results that matches the query, where result error can be UnauthorizedError
Load many entities where fieldName equals fieldValue.
entity field being queried
fieldName field value being queried
array of entity results that match the query for fieldValue, where result error can be UnauthorizedError
Load many entities where fieldName is one of fieldValues.
entity field being queried
fieldName field values being queried
map from fieldValue to entity results that match the query for that fieldValue, where result errors can be UnauthorizedError
Loads many entities matching the selection constructed from the conjunction of specified operands. Entities loaded using this method are not batched or cached.
list of field equality selection operand specifications
limit, offset, and orderBy for the query
array of entity results that match the query, where result error can be UnauthorizedError
fieldEqualityOperands:
`[{fieldName: 'hello', fieldValue: 1}, {fieldName: 'world', fieldValues: [2, 3]}]`
Entities returned with a SQL EntityDatabaseAdapter:
`WHERE hello = 1 AND world = ANY({2, 3})`
Loads many entities for a list of IDs.
IDs of the entities to load
map from ID to corresponding entity result, where result error can be UnauthorizedError or EntityNotFoundError.
Loads many entities for a list of IDs, returning null for any IDs that are non-existent.
IDs of the entities to load
map from ID to nullable corresponding entity result, where result error can be UnauthorizedError or EntityNotFoundError.
Loads many entities matching the raw WHERE clause. Corresponds to the knex whereRaw
argument format.
parameterized SQL WHERE clause with positional binding placeholders or named binding placeholders
array of positional bindings or object of named bindings
limit, offset, orderBy, and orderByRaw for the query
array of entity results that match the query, where result error can be UnauthorizedError
Important notes:
rawWhereClause: `id = ?`
bindings: `[1]`
Entites returned `WHERE id = 1`
http://knexjs.org/#Builder-whereRaw
http://knexjs.org/#Raw-Bindings
Error when rawWhereClause or bindings are invalid
prefer caching loaders
Private
tryPrivate
validateGenerated using TypeDoc
The primary interface for loading entities. All normal loads are batched, cached, and authorized against the entity's EntityPrivacyPolicy.