Setu-TS
    Preparing search index...

    Type Alias DynamoAdapterOptions

    DynamoAdapterOptions:
        | DynamoAdapterOptionsBase & {
            client?: IDynamoClient;
            credentials?: unknown;
            endpoint?: string;
            region: string;
        }
        | DynamoAdapterOptionsBase & {
            client: IDynamoClient;
            credentials?: unknown;
            endpoint?: string;
            region?: string;
        }

    Options for the DynamoAdapter — the 'dynamodb' arm.

    A union of two arms, so supplying neither region nor client is a compile error rather than a connect() throw — the guarantee every other built-in arm gives ('prisma' requires prismaClient, 'mongodb' requires url or client, 'custom' requires adapter). region is the lazy arm's required member because the AWS SDK cannot resolve a region from nothing, while endpoint stays optional: it names an emulator such as DynamoDB Local and is absent in production, where the region's own endpoint applies. Both members stay readable on either arm, so the adapter reads options.region and options.client without narrowing first.

    Type Declaration

    • DynamoAdapterOptionsBase & {
          client?: IDynamoClient;
          credentials?: unknown;
          endpoint?: string;
          region: string;
      }
      • Optional Readonlyclient?: IDynamoClient

        An already-constructed client; omit it to load the SDK lazily.

      • Optional Readonlycredentials?: unknown

        AWS credentials or an SDK-supported credential provider. Omitted in production so the SDK's own provider chain applies.

      • Optional Readonlyendpoint?: string

        An optional custom endpoint, such as DynamoDB Local. Absent in production, where the region's own endpoint applies.

      • Readonlyregion: string

        The AWS region supplied to the constructed DynamoDBClient.

        Required on the lazy arm: the SDK's signer needs a region even against DynamoDB Local, and M80's suite pins one ('us-east-1') rather than letting it vary.

    • DynamoAdapterOptionsBase & {
          client: IDynamoClient;
          credentials?: unknown;
          endpoint?: string;
          region?: string;
      }
      • Readonlyclient: IDynamoClient

        An already-constructed IDynamoClient.

        When present, the lazy import('@aws-sdk/client-dynamodb') never runs — the seam that keeps the branching unit-testable — and the client is never destroyed on disconnect(), because it belongs to the application.

      • Optional Readonlycredentials?: unknown

        AWS credentials; unread once a client is injected.

      • Optional Readonlyendpoint?: string

        The custom endpoint; unread once a client is injected. It stays an optional member on both arms so the adapter reads options.endpoint without narrowing first — the MongoAdapterOptions shape.

      • Optional Readonlyregion?: string

        The AWS region; unread once a client is injected.

    const lazy: DynamoAdapterOptions = { region: 'us-east-1' };
    const injected: DynamoAdapterOptions = { client: myDynamoClient };

    0.2.0