chocofamilyme / laravel-tarantool
基于 Tarantool 的 Eloquent ORM 和查询构建器,用于 Laravel
1.1.2
2022-04-06 05:46 UTC
Requires
- php: ^7.3|^8.0
- illuminate/container: ^8.0
- illuminate/database: ^8.0
- illuminate/events: ^8.0
- illuminate/support: ^8.0
- rybakit/msgpack: ^0.7
- tarantool/client: ^0.9.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- vimeo/psalm: ^4.1.0
This package is auto-updated.
Last update: 2024-09-06 11:22:59 UTC
README
此包为 Tarantool 的 Eloquent 模型和查询构建器添加功能,使用原始 Laravel API。 此库扩展了原始 Laravel 类,因此使用完全相同的方法。
安装
Laravel 版本兼容性
通过 Composer
composer require chocofamilyme/laravel-tarantool
配置
您可以将 Tarantool 用作主数据库或辅助数据库。为此,请向 config/database.php
中添加一个新的 tarantool
连接
'tarantool' => [ 'driver' => 'tarantool', 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', 3301), 'database' => env('DB_DATABASE'), 'username' => env('DB_USERNAME'), 'password' => env('DB_PASSWORD'), 'driver_oprions' => [ 'connection_type' => env('DB_CONNECTION_TYPE', 'tcp') ], 'options' => [ 'connect_timeout' => 5, 'max_retries' => 3 ] ],
设置 Tarantool 为主数据库
'default' => env('DB_CONNECTION', 'tarantool'),
您还可以使用dsn字符串配置连接
'tarantool' => [ 'driver' => 'tarantool', 'dsn' => env('DB_DSN'), 'database' => env('DB_DATABASE'), ],