The entity type managed by this repository.
Deletes all records from the store.
Returns the total number of records in the store.
A promise resolving to the record count.
Persists a new record.
Key generation (if configured) and timestamp injection (__idb_createdAt,
__idb_updatedAt) are applied before storage. Validation rules are
enforced prior to the write.
The entity instance to store.
Persists multiple records sequentially. Equivalent to calling EntityRepository.create for each item.
An array of entity instances to store.
Removes the record identified by key.
The primary key value. Pass an array for composite keys.
Removes multiple records by their primary keys.
An array of primary key values.
Returns whether a record with the given primary key exists.
The primary key to check.
true if a matching record exists, false otherwise.
Returns all records whose indexed field equals value.
The name of the IDB index to query.
The index key to look up.
Returns the first record whose indexed field equals value, or
undefined if none is found.
The name of the IDB index to query.
The index key to look up.
Returns all records in the store.
A promise resolving to an array of all entities.
Returns a page of records from the store.
1-based page number.
Number of records per page.
A promise resolving to the requested page.
Returns a new QueryBuilder scoped to this entity's object store, optionally sharing the supplied transaction.
A fresh QueryBuilder instance ready for chaining.
Retrieves a record by its primary key.
The primary key value. Pass an array for composite keys.
A promise resolving to the entity, or undefined if not found.
Replaces an existing record with the supplied entity.
Preserves the original __idb_createdAt timestamp and refreshes
__idb_updatedAt. Validation rules are enforced prior to the write.
The updated entity instance.
Updates multiple records sequentially. Equivalent to calling EntityRepository.update for each item.
An array of updated entity instances.
The full CRUD and query surface exposed for each registered entity.
An
EntityRepository<T>is created automatically by Database.build and is accessible as a named property on the returned database object (e.g.,db.User,db.Order).Example