property DynamoAdapterOptionsBase.entities
Since 0.1.0

Per-entity table and key mappings, keyed by the entity name passed to getRepository().

An entity with no entry uses its own name as the table and 'id' as the partition key; a mapped entity states its partition key explicitly, because DynamoDB has no implicit key to guess — the write guards and every key builder read this attribute by name.

Examples

Example 1

new DynamoAdapter({
  region: 'us-east-1',
  entities: { Order: { table: 'orders', partitionKey: 'tenantId', sortKey: 'orderId' } },
});

Type

Readonly<Record<string, DynamoEntityMapping>>

Usage

import { type DynamoAdapterOptionsBase } from "database-plugin/src/index.ts";