prorm API Reference
    Preparing search index...

    Function Generated

    • Decorator for generated/computed columns.

      Usage with getter (for computed properties):

        class User extends Model {
      @Generated()
      get fullName() {
      return `${this.firstName} ${this.lastName}`;
      }
      }

      Usage with options:

        @Generated({
      as: 'CONCAT(first_name, " ", last_name)',
      type: 'varchar(255)',
      stored: true
      })
      fullName: string;

      Parameters

      Returns PropertyDecorator