clarkie / dynogels

DynamoDB data mapper for node.js. Originally forked from https://github.com/ryanfitz/vogels
Other
491 stars 110 forks source link

Is it possible to run dynogels with version 3 of AWS #195

Open supercsc opened 3 years ago

supercsc commented 3 years ago

Dynogels runs by default with AWS Version 2. However it does allow you to pass in your own DynamoDB driver, and since AWS Version 3 is out I was wondering if it was possible to pass in a Version 3 dynamo driver. I have attempted to do this:

import dynogels from 'dynogels-promisified';
import {DynamoDB} from "@aws-sdk/client-dynamodb"; //Version 3 driver
const v3Dynamo: DynamoDB = new DynamoDB({ region: REGION });
dynogels.dynamoDriver(v3Dynamo); //Pass in our own driver

But I got the following error:

/node_modules/aws-sdk/lib/dynamodb/document_client.js:86
      self.service = new self.service.constructor.__super__(config);
                     ^
TypeError: self.service.constructor.__super__ is not a constructor

I also attempted this with the V3 DynamoDBClient but got the same error.