mhthnz/yii2-tarantool Tarantool connector for yii2 framework. Allows to perform SQL and NoSQL queries, ActiveRecord, Schemas and more.

Tarantool connector for yii2 framework

  1. Reqirements
  2. Installation
  3. Configuration
  4. Features
  5. Future plans
  6. Running tests

Latest Stable Version Latest Unstable Version Master Branch Tests Score Coverage

Tarantool connector for yii2 framework. Allows to perform SQL and NoSQL queries, framework abstractions such as ActiveRecord, Schema, TableSchema, Query, ActiveQuery and etc using tarantool database.

Documentation is here: docs/README.md

Reqirements

Packagist PHP Version Support Tarantool version Yii2 version

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist mhthnz/yii2-tarantool "*"

or add

"mhthnz/yii2-tarantool": "*"

to the require section of your composer.json file.

Configuration

  • Dsn options
    return [
      'bootstrap' => ['debug'],
      'components' => [
          // Tarantool connection setup
          'tarantool' => [
              'class' => \mhthnz\tarantool\Connection::class,
              'dsn' => 'tcp://username:password@localhost:3301/?connect_timeout=5&max_retries=3',
          ],
      ],
      'modules' => [
          //Debug panel setup
          'debug' => [
              'class' => 'yii\debug\Module',
              'panels' => [
                  'tarantool' => [
                      'class' => \mhthnz\tarantool\debug\TarantoolPanel::class,
                      'db' => 'tarantool', // Tarantool component id
                  ],
              ],
              'allowedIPs' => ['127.0.0.1', '::1'],
          ],
      ],
    ];
    

Features

Future plans

  • I18n source
  • Transactions
  • Gii code generator (models, crud, queries)
  • Connection slaves support
  • Queue
  • Cache

Running tests

  • First of all you need to run tarantool and bind it to localhost:3301
$ docker run --name mytarantool -p3301:3301 -d tarantool/tarantool:2.4.1
  • Install php deps
    $ sudo apt install php-mbstring php-dom
    

$ sudo apt install php7.3-mbstring php7.3-dom # or specify php version `

  • Install vendor
    $ php composer install
    

$ php7.3 composer.phar install # or specify php version `

  • Run phpunit tests
    $ php ./vendor/phpunit/phpunit/phpunit --bootstrap ./tests/_bootstrap.php --configuration ./phpunit.xml.dist 
    
1 0
1 follower
78 downloads
Yii Version: 2.0
License: GPL-3.0+
Category: Database
Developed by: Andrey
Created on: Sep 3, 2021
Last updated: (not set)
Packagist Profile
Github Repository

Related Extensions