ginkida / laravel-tarantool
基于 Tarantool 的 Eloquent ORM 和查询构建器,适用于 Laravel
1.0.3
2021-04-28 11:25 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.8
- 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-28 19:26:03 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'), ],