dyna-record
    Preparing search index...

    Type Alias TableClientOptions

    TableClientOptions:
        | { client?: DynaRecordDocumentClient; clientConfig?: never }
        | { client?: never; clientConfig?: DynamoDBClientConfig }

    How a table reaches DynamoDB.

    Supply neither option and dyna-record constructs a client with the AWS SDK's default resolution: region from AWS_REGION / AWS_DEFAULT_REGION or the shared config profile, credentials from the provider chain, and endpoint from AWS_ENDPOINT_URL_DYNAMODB / AWS_ENDPOINT_URL — which is all a local DynamoDB needs.

    The two options are mutually exclusive: clientConfig configures the client dyna-record constructs, client replaces it.

    @Table({ name: "storefront", clientConfig: { region: "us-east-1" } })
    abstract class Storefront extends DynaRecord {}
    @Table({
    name: "storefront",
    client: DynamoDBDocumentClient.from(new DynamoDBClient({ region: "us-east-1" }))
    })
    abstract class Storefront extends DynaRecord {}

    Decorators evaluate at module load, before application bootstrap runs, so a client built during startup is not available here. Delegate to it instead:

    @Table({
    name: "storefront",
    client: { send: command => getClient().send(command) }
    })
    abstract class Storefront extends DynaRecord {}