kitar / laravel-dynamodb

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

Support multiple expression types for wheres #3

Closed kitar closed 4 years ago

kitar commented 4 years ago

QueryBuilder uses wheres attribute to handle the source for ConditionExpression KeyConditionExpression and FilterExpression like below.

DB::table('ProductCatalog')
    ->where('Id', 'attribute_not_exists')
    ->whereAsCondition()
    ->putItem(...);
$items = DB::table('Thread')
             ->where('ForumName', '=', 'Amazon DynamoDB')
             ->whereAsKeyCondition()
             ->query();
$items = DB::table('Thread')
             ->where('LastPostedBy', '=', 'User A')
             ->whereAsFilter()
             ->scan();

It can't be used for multiple expression types at the same time because it shares a single wheres attribute. Need to re-design this.