dnocode/yii2-awsddb 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dnocode/yii2-awsddb

最新稳定版本:v1.0.2

Composer 安装命令:

composer require dnocode/yii2-awsddb

包简介

Amazon dynamo db ActiveRecord for the Yii framework

README 文档

README

This extension provides activeRecord support for amazon dynamo db

return [ //.... 'components' => [ ddb' => [ "class"=>'dnocode\awsddb\ar\Connection', 'base_url'=>"http://localhost:8000 [OPTIONAL ONLY FOR DYNAMO LOCAL]", 'key' => 'AMAZONKEY', 'secret' => 'AMAZONSECRET', 'region' => 'eu-west-1' ], ] ];

Installation

Add to composer dependencies

"dnocode/yii2-awsddb": "*"

USING

How to define a model

class Element {

   public $name;
   public $surname;
   public $sex;
   public $uid;

    /**hash and range**/
    public static function primaryKey(){ return ["uid"];}

    public function rules(){    return [[['uid'], 'required']];}
}

#put

$e=new Element();
$e->name
$e->name="nerd";
$e->surname="iam";
$e->sex="no_nerd_i_said";
$e->uid="ciao";
$e->save();

#find and update

 $element=Element::find()->where(["uid"=>"ciao"])  ->one();
 $element->surname="update";
 $consumer->save();

#delete and update

 $element=Element::find()->where(["uid"=>"ciao"])  ->one();
 $element->delete();
 Element::deleteAll(["uid"=>"ciao"]);

find with where

  $element=Element::find()->
          where(["surname"=>"iam"])
          ->one();

Find object with the hash key

the active record will use
 get operation 4  performance*/

```
$element=Element::find()->
        andWhere("uid")
        ->eq("ciao")
        ->all();*/
 ```

Execute find on attribute that isn`t primary key

    will be execute a scan operation with filter on that attribute

```
$element=Element::find()->
        andwhere("surname")->eq("prova")
        ->all();
```

Compare attribute with more than one value

```
 $element=Element::orWhere("name")->in(["name1","name2"])
 ->all();
```

#TODO

  1. batch operations with transaction
  2. support for relation
  3. iterator for query with more than 1MB

统计信息

  • 总下载量: 110
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 3
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-12-30