kitar / laravel-dynamodb

A DynamoDB based Eloquent model and Query builder for Laravel.
MIT License
179 stars 27 forks source link

Error with the Dynamo Pagination #40

Closed raphaelcangucu closed 8 months ago

raphaelcangucu commented 8 months ago

This PR will fix last evaluated key when the collection is empty and we can still have results at the dynamo.

When the result don't contain any itens, but we still have a lastEvaluatedKey at the Dynamo response, this means that we still has to confirm if we have or not values at the dynamo.

The function processMultipleItems at the processor was adding the meta at the collection items.

To solve this it was extended the Laravel Collection and created a new attribute to add the meta to the collection, so we can access at the lastEvaluatedKey from the collection instead of the item that don't exist.

thiago-a-delgado commented 8 months ago

Awesome! I need this fix!

paulojosegamba commented 8 months ago

Amazing

codeninja115 commented 8 months ago

Great, I also need this fix. Hope it can be merged soon.

kitar commented 8 months ago

@raphaelcangucu Thank you so much for the fantastic PR! I really appreciate it.

It seems like this is something we should have implemented from the beginning. I'd also like to consider removing metadata at the model level in the next major version.

We'll release it right after adding some tests and docs!

DanielMukh commented 8 months ago

Thanks! When can we expect the release?

kitar commented 8 months ago

Assuming testing proceeds without any issues, I believe we can release it in a day or two!

DanielMukh commented 8 months ago

Awesome, look forward to it!

raphaelcangucu commented 8 months ago

Thanks @kitar , let me know if you need some help coding.