Represents the metadata for a table within the ORM framework, encapsulating information such as table name, key attributes, and default field mappings. This class is fundamental for defining how entities are mapped to their underlying database tables, providing a schema-like structure that includes both key configuration and default attribute handling.

The metadata includes the partition and sort key attributes of the table, which are essential for database operations. It also provides a mechanism to include default attributes and their mappings, supporting common fields like id, type, createdAt, and updatedAt, along with their serialization strategies, particularly for date fields.

Param: options

Configuration options for the table metadata.

Constructors

Properties

defaultAttributes: Record<DefaultFields, AttributeMetadata>

A record of default attributes for the entity, keyed by entity field names.

defaultTableAttributes: Record<string, AttributeMetadata>

A record of default attributes for the table, keyed by table field aliases.

delimiter: string

A delimiter used in the table's composite keys.

name: string

The name of the table.

partitionKeyAttribute: AttributeMetadata

Metadata for the table's partition key attribute.

reservedKeys: Record<string, true>

Represents the keys that should be excluded from schema validation. These keys are reserved by dyna-record and should be managed internally.

While dyna-record employs type guards to prevent the setting of these keys, this ensures additional runtime validation.

The reserved keys include:

  • pk
  • sk
  • id
  • type
  • createdAt
  • updatedAt
  • foreignKey
  • foreignEntityType
sortKeyAttribute: AttributeMetadata

Metadata for the table's sort key attribute.

Methods

Generated using TypeDoc