kitar/laravel-dynamodb

Support multiple expression types for wheres

Closed this issue · 0 comments

kitar commented

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.