Skip to content
This repository was archived by the owner on Jun 22, 2021. It is now read-only.

Commit 222caf3

Browse files
authored
docs(options): Adds recommendations for entities.
1 parent 7a47d4d commit 222caf3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/options.md

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ This interface is user-defined hence not contained in this package, the interfac
2323

2424
When using js-entity-repos all entities should have a single unique identifier (the [`id`](#id) property) because the Facade functions do not support composite keys. There are a number of pros and cons to this that you can discover with a little Googling, but be aware that some databases actually enforce a single identifier anyway (such as Mongo). The main reason composite keys are not supported here is that it simplifies routing in HTTP implementations of the Facade such as [Axios](https://github.com/js-entity-repos/axios) and [Express](https://github.com/js-entity-repos/express).
2525

26+
It's usually useful and recommended to create your own Entity interface to use as a base interface for your entities. This is useful for adding common properties across your entities such as timestamps (like `createdAt` and `updatedAt`). Since the js-entity-repos make no attempt at validation, you might also find it useful to use a validation package like [Rulr](https://www.npmjs.com/package/rulr).
27+
2628
```ts
2729
import Entity from '@js-entity-repos/core/dist/types/Entity';
2830

0 commit comments

Comments
 (0)