EntityOptions
Options relating to the internal handling of entities.
entityIdStrategy
<a href='/reference/typescript-api/configuration/entity-id-strategy#autoincrementidstrategy'>AutoIncrementIdStrategy</a>Defines the strategy used for both storing the primary keys of entities in the database, and the encoding & decoding of those ids when exposing entities via the API. The default uses a simple auto-increment integer strategy.
Note: changing from an integer-based strategy to a uuid-based strategy on an existing Vendure database will lead to problems with broken foreign-key references. To change primary key types like this, you'll need to start with a fresh database.
entityDuplicators
defaultEntityDuplicatorsAn array of EntityDuplicator instances which are used to duplicate entities
when using the duplicateEntity mutation.
moneyStrategy
<a href='/reference/typescript-api/money/default-money-strategy#defaultmoneystrategy'>DefaultMoneyStrategy</a>Defines the strategy used to store and round monetary values.
channelCacheTtl
numberv1.3.030000Channels get cached in-memory as they are accessed very frequently. This setting determines how long the cache lives (in ms) until it is considered stale and refreshed. For multi-instance deployments (e.g. serverless, load-balanced), a smaller value here will prevent data inconsistencies between instances.
zoneCacheTtl
numberv1.3.030000Zones get cached in-memory as they are accessed very frequently. This setting determines how long the cache lives (in ms) until it is considered stale and refreshed. For multi-instance deployments (e.g. serverless, load-balanced), a smaller value here will prevent data inconsistencies between instances.
taxRateCacheTtl
numberv1.9.030000TaxRates get cached in-memory as they are accessed very frequently. This setting determines how long the cache lives (in ms) until it is considered stale and refreshed. For multi-instance deployments (e.g. serverless, load-balanced), a smaller value here will prevent data inconsistencies between instances.
metadataModifiers
[]Allows the metadata of the built-in TypeORM entities to be manipulated. This allows you to do things like altering data types, adding indices etc. This is an advanced feature which should be used with some caution as it will result in DB schema changes. For examples see EntityMetadataModifier.
slugStrategy
<a href='/reference/typescript-api/configuration/default-slug-strategy#defaultslugstrategy'>DefaultSlugStrategy</a>Defines the strategy for generating slugs from input strings. Slugs are URL-friendly versions of text commonly used for entity identifiers in URLs.
A function which allows TypeORM entity metadata to be manipulated prior to the DB schema being generated during bootstrap.
Certain DB schema modifications will result in auto-generated migrations which will lead to data loss. For instance, changing the data type of a column will drop the column & data and then re-create it. To avoid loss of important data, always check and modify your migration scripts as needed.
Example
Example