Interface AttributeMetadataOptions

Defines the options for configuring attribute metadata within the ORM system. This interface specifies the settings used to describe and manage an attribute's representation and behavior in both the entity model and the underlying database schema, particularly focusing on attributes' names, aliases, nullability, and serialization strategies.

interface AttributeMetadataOptions {
    alias?: string;
    attributeName: string;
    nullable: boolean;
    serializers?: Serializers;
}

Properties

alias?: string

An optional alias for the attribute that represents its name within the database. This is used for mapping the attribute to its corresponding column in the database table. If not specified, the attributeName is used as the column name.

attributeName: string

The name of the attribute as defined in the entity. This is the primary identifier for the attribute within the ORM and is used in entity operations.

nullable: boolean

Indicates whether the attribute is allowed to have null values. This property is crucial for enforcing data integrity and validation rules at the database level.

serializers?: Serializers

Optional custom serialization strategies for the attribute. These strategies define how to convert the attribute's value between its representation in the entity and its representation in the database. This is particularly useful for handling complex data types or custom transformations.

Generated using TypeDoc