mhthnz/yii2-tarantool

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

Installs: 8

Dependents: 0

Suggesters: 0

Security: 0

Stars: 11

Watchers: 3

Forks: 0

Open Issues: 0

Type:yii2-extension

v1.0.3 2021-10-09 16:47 UTC

This package is auto-updated.

Last update: 2021-10-12 10:31:57 UTC


README

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

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

  • Tarantool Connection has Command and QueryBuilder
  • ActiveRecord models with ActiveQuery support
  • Schema abstraction, TableSchema and ColumnSchema
  • Compatible with AR validators UniqueValidator, ExistsValidator
  • Supports data widgets like DetailView, ListView, GridView using ActiveDataProvider
  • Debug panel with explain is able to show SQL and NoSQL requests.
  • Migrations
  • Nosql Query and Command for performing nosql requests
  • Lua validator

Future plans

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