awslabs / dynamodb-data-mapper-js

A schema-based data mapper for Amazon DynamoDB.
https://awslabs.github.io/dynamodb-data-mapper-js/
Apache License 2.0
816 stars 106 forks source link

aws-sdk dependency #211

Open stormsa opened 2 years ago

stormsa commented 2 years ago

Hello,

According to aws documentation, aws-sdk is included in lambda container : https://docs.aws.amazon.com/lambda/latest/dg/lambda-nodejs.html But your library also includes aws-sdk in dependencies. Is it mandatory ? My package is 70mb larger since I use your package :-/

Can you move dependency in optionnalDependency since it's already included in lambda node runtime ? Edit : It's seems dependency is in peerDependency but npm8 install peerdependency auto. Can you add : "peerDependenciesMeta": { "aws-sdk": { "optional": true } }

Thank you

wz2b commented 1 year ago

I'd like to know the answer to this, too ... and also if you can use the v3 API:

import {DynamoDB} from "@aws-sdk/client-dynamodb";
        const client = new DynamoDB({});
        this.mapper = new DataMapper({
            client: client
        })

gives me this:

    "errorMessage": "this.client.scan(...).promise is not a function"

and I'm not sure what to do about it.

Berger92 commented 1 year ago

@wz2b Based on its package.json file, and the error you shared above, this library only works with v2 API.

Berger92 commented 1 year ago

@wz2b Based on its package.json file, and the error you shared above, this library only works with v2 API.