Back to Sequelize

Decorator Info

docs/_fragments/_decorator-info.mdx

latest1.1 KB
Original Source

:::info

Sequelize currently only supports the legacy/experimental decorator format. Support for the new decorator format will be added in a future release.

All decorators must be imported from @sequelize/core/decorators-legacy:

ts
import { Attribute, Table } from '@sequelize/core/decorators-legacy';

Using legacy decorators requires to use a transpiler such as TypeScript, Babel or others to compile them to JavaScript. Alternatively, Sequelize also supports a legacy approach that does not require using decorators, but this is discouraged.

If you're using TypeScript, you will also need to configure it to be able to resolve this export, see our Getting Started guide for more information.

:::