Code Monkey home page Code Monkey logo

apollo-datasource-dynamodb's People

Contributors

cmwhited avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

apollo-datasource-dynamodb's Issues

Ability to get LastEvaluatedKey

It would be great to allow clients access to the LastEvaluatedKey returned as part of a DynamoDB query so that they can paginate if required

batchWrite / batchGet && transactGet / transactWrite

Hey Chris,

Thanks for writing this datasource. Have enjoyed using it in my project. There has come a need for us to do batchWrite/ transactWrite in our project and I love the way your code has an inbuilt datasource cache. Are there any plans to add this additional functionality to your repo?

Cheers,
jack

Calling DynamoDBDataSource.initialize isn't documented

I've created a subclass and upon first calling getMyItem it calls the inherited getItem which is implemented through the caching mechanism which isn't initialized unless initialize is explicitly called. It looks like reasonable defaults are specified so it seems like it could work without requiring the initialize call. In my own code I had to do the following:

export var CHPDS = new CHPIncidentsDS(defaultConfiguration);
CHPDS.initialize({ context: CHPDS.dynamoDbDocClient, cache: new InMemoryLRUCache() });

I see in the cache class that "new InMemoryLRUCache()" is the default value but when calling initialize the complier won't let me only pass the "context" key therefore the default for the cache param isn't used.

Ability to provide DDB client

Can we extend the constructor to allow clients to provide the DDB client? This can serve as an optimization if used with dependency injection.

Support for AWS-SDK 3

Hi team,
Thanks for this amazing library. Is there a possibility to add support for AWS SDK v3?

`query` method will benefit reading from cache

The query method in DynamoDBDataSource is only setting the items in cache. It would be good to see it read from the cache before it hits the DynamoDB.

Only getItem seems to be reading the cache currently.

'super' must be called before accessing 'this' in the constructor of a derived class

I have created following class:

export default class AccountTable extends DynamoDBDataSource<AccountItem> {
  constructor(config?: ClientConfiguration) {
    super(this.tableName, this.tableKeySchema, config);
  }

  private readonly tableName = 'accounts';
  private readonly tableKeySchema: DocumentClient.KeySchema = [
    {
      AttributeName: 'accountId',
      KeyType: 'HASH',
    },
  ];
}

But I got the following error:

'super' must be called before accessing 'this' in the constructor of a derived class.ts(17009)

Do you have an solution for this? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.