2017 © Pedro Peláez
 

yii2-extension yii2-cassandra-cql

A Cassandra CQL3 client wrapper over phpcassa for Yii 2

image

beliy/yii2-cassandra-cql

A Cassandra CQL3 client wrapper over phpcassa for Yii 2

  • Monday, December 26, 2016
  • by beliy
  • Repository
  • 2 Watchers
  • 5 Stars
  • 189 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

Deprecated

Phpcassa has been deprecated and will no longer be supported! Please use https://github.com/datastax/php-driver, (*1)

yii2-cassandra-cql

A Cassandra CQL3 client wrapper over phpcassa for Yii 2, (*2)

Provides object oriented access to Cassandra using CQL3 in a familiar Yii Style. This project is a wrapper over the famous phpcassa library., (*3)

This extension also handles issues with the phpcassa library 'Data Types' while using the latest CQL3 API provided by cassandra. The following discussion on StackOverflow describes the problem:, (*4)

http://stackoverflow.com/questions/16139362/cassandra-is-not-retrieving-the-correct-integer-value, (*5)

Installation

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

Either run, (*7)

php composer.phar require --prefer-dist beliy/yii2-cassandra-cql "*"

or, (*8)

composer require beliy/yii2-cassandra-cql:dev-master

or add, (*9)

"beliy/yii2-cassandra-cql": "*"

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

Usage

'components' => [
...
  'cassandra' => [
        'class' => '\beliy\cassandra\Connection',
        'keyspace' => 'youkeyspace',
        'servers' => ['127.0.0.1', ...],
    ],
    'cache' => [
      'class' => '\beliy\cassandra\Cache',
      'tableName' => 'cache', // dedault 'cache'
      'tablePrefix' => 'mega', // default ''
    ],
    ...
  ]

  $cass = Yii::$app->cassandra;
  $cql = 'SELECT value FROM yourtable WHERE id=1';
  $query_result = $cass->cql3Query($cql);
  $rows = $cass->cqlGetRows($query_result);

  Usage for cache:
  First you may init column fammily storage fro cache.
  $cache = Yii::$app->cache;
  $cache->createTable();

  Than use standart Yii2 Cache APIs.

REQUIREMENTS, (*11)

Yii 2.0.3 / PHP 5.5+, (*12)

Resources, (*13)

Fork extensions from http://www.yiiframework.com/extension/cassandra-cql, (*14)

External Projects used in this extension is the phpcassa library for PHP and Cassandra https://github.com/thobbs/phpcassa, (*15)

The Versions

26/12 2016

dev-master

9999999-dev

A Cassandra CQL3 client wrapper over phpcassa for Yii 2

  Sources   Download

MIT

The Requires

 

by Dima Beliy

extension yii2 cassandra phpcassa