ComputedColumn

ComputedColumn Decorator

The ComputedColumn decorator is used to define computed columns in the database. It takes a ComputedColumnDecoratorInterface object as a parameter, which contains settings for the computed column.

Parameters of ComputedColumnDecoratorInterface

  • name:

    • Type: string

    • Description: Specifies the name of the computed column in the database. If not provided, the property name in the class is used.

  • dataType:

    • Type: PostgresqlDataTypes | MysqlDataTypes

    • Description: Specifies the data type for the computed column depending on the database type (PostgreSQL or MySQL).

  • calculate:

    • Type: string

    • Description: Defines the formula or expression to be used for computing the column's value. The formula is written as a SQL query.

Last updated