Represents the metadata for an attribute of an entity, including its name, alias (if any), nullability, and serialization strategies.

Serialization strategies are essential for attributes whose types do not natively exist in DynamoDB, such as Date objects, enabling custom conversion between the entity representation and the database representation. These strategies ensure that the ORM can seamlessly handle a wide range of attribute types beyond those natively supported by DynamoDB.

Param: options

Configuration options for the attribute metadata, including the attribute's name, optional alias, nullability, and serialization strategies.

Constructors

Properties

alias: string

The name of the attribute as defined in the database table. If not provided, it defaults to the name of the attribute. This alias is used for database operations to map the attribute to its corresponding database column.

name: string

The name of the attribute as defined on the entity. This serves as the primary identifier for the attribute within the ORM.

nullable: boolean

Indicates whether the attribute can be null, defining the attribute's nullability constraint within the database.

serializers?: Serializers

Optional serialization strategies for converting the attribute between its database representation and its entity representation. This is particularly useful for custom data types not natively supported by DynamoDB.

type: ZodType<any, ZodTypeDef, any>

Zod validator to run on the attribute

Generated using TypeDoc