2017 © Pedro Peláez
 

library yii2-dynamodb

DynamoDB extensions for Yii2

image

urbanindo/yii2-dynamodb

DynamoDB extensions for Yii2

  • Wednesday, June 20, 2018
  • by urbanindo
  • Repository
  • 6 Watchers
  • 8 Stars
  • 11,086 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 10 Forks
  • 3 Open issues
  • 10 Versions
  • 5 % Grown

The README.md

DynamoDB extensions for Yii2

This is a DynamoDB extension for Yii2, (*1)

Latest Stable Version Total Downloads Latest Unstable Version Build Status, (*2)

Requirement

This extension requires - PHP minimum 7.0 and before 7.2 (Upgrade is still underwork) - Yii2 minimum 2.0.13 and lesser than 2.1 - AWS PHP SDK 3.28, (*3)

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

php composer.phar require --prefer-dist urbanindo/yii2-dynamodb "*"

or add, (*6)

"urbanindo/yii2-dynamodb": "*"

to the require section of your composer.json file., (*7)

Setting Up

After the installation, sets the dynamodb component in the config., (*8)

return [
    // ...
    'components' => [
        // ...
        'dynamodb' => [
            'class' => 'UrbanIndo\Yii2\DynamoDb\Connection',
            'config' => [
                //This is the config used for Aws\DynamoDb\DynamoDbClient::factory()
                //See http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-dynamodb.html#factory-method
                'credentials' => [
                    'key'    => 'YOUR_AWS_ACCESS_KEY_ID',
                    'secret' => 'YOUR_AWS_SECRET_ACCESS_KEY',
                ],
                'region' => 'ap-southeast-1',
            ]
        ]
    ],
];

Limitation

Because DynamoDB have different behavior from MySQL, there are several limitations or behavior change applied. There are several method to get data from DynamoDB: GetItem, BatchGetItem, Scan, and Query., (*9)

  1. We have tried to implement automatic method to acquire model from Query. You should assign method explicitly if you want to force the method to use.
  2. Not yet support attribute name aliasing (In MySQL known as field aliasing).
  3. When using Query method, where condition just support filter by key attributes. In next roll out we will add filtering with non key attributes.
  4. To make pagination, we forcedly using Query method when WHERE condition is set. Because if you use filtering with non key attribute, it is possible the model result(s) will less than desired limit value.
  5. indexBy and orderBy cannot use with attribute string value or callable parameter. This will use as string value and assign to IndexName parameter in DynamoDB. To use sorting, this will forcedly use QUERY method and orderBy parameter should be either ['myIndex' => 'ASC'] or ['myIndex', 'DESC'] and key condition expression should be defined.
  6. Not support NULL and any kind of set attribute type.
  7. Not support attribute aliasing belong to Reserve Keywords, which means all attributes do not using any Reserve Keywords.
  8. When use LinkPager, do not forget use ActiveDataProvider from this package. When the pagination pass into any kind of Widget View, several components maybe unsupported like SerialColumn, unnecessary total items in summary, and sorting.

The Versions

20/06 2018

dev-upgrade-compatibility-with-yii-2-0-13

dev-upgrade-compatibility-with-yii-2-0-13

DynamoDB extensions for Yii2

  Sources   Download

BSD License

The Requires

 

The Development Requires

by Petra Barus

03/11 2015

0.9

0.9.0.0

DynamoDB extensions for Yii2

  Sources   Download

BSD License

The Requires

 

The Development Requires

by Petra Barus

25/08 2015

dev-wip-dynamodb

dev-wip-dynamodb

DynamoDB extensions for Yii2

  Sources   Download

BSD License

The Requires

 

The Development Requires

by Petra Barus

20/08 2015

dev-add-dynamodb-tester

dev-add-dynamodb-tester

DynamoDB extensions for Yii2

  Sources   Download

BSD License

The Requires

 

The Development Requires

by Petra Barus