This is a DynamoDB extension for Yii2
This extension requires
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist urbanindo/yii2-dynamodb "*"
or add
"urbanindo/yii2-dynamodb": "*"
to the require section of your composer.json
file.
After the installation, sets the dynamodb
component in the config.
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',
]
]
],
];
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.
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.All notable changes to this project will be documented in this file.
ActiveDataProvider
and Pagination
Comments