Skip to content

postgrelize / AllowNull

Variable: AllowNull ​

const AllowNull: ModelPropertyDecorator & ((argument?) => ModelPropertyDecorator)

Defined in: src/decorators/column-decorators.ts:78

Sets allowNull. Usable bare (@AllowNull, meaning true) or called.

Param ​

allowNull

Whether NULL is allowed.

Default Value ​

ts
true

Returns ​

An attribute decorator.

Example ​

ts
class User extends Model {
  @AllowNull(false)
  @Column(DataTypes.TEXT)
  name!: string;
}

Released under the MIT License.