kkszymanowski/laravel-6-firebird
Composer 安装命令:
composer require kkszymanowski/laravel-6-firebird
包简介
A Firebird database package for Laravel 6
README 文档
README
Package inspired by jacquestvanzuydam/laravel-firebird but simplified, modernized and made compatible with Laravel 6, 7 and 8.
I do not create my own Firebird databases, only read from existing ones so the INSERT and UPDATE support may be spotty.
Installation
composer require kkszymanowski/laravel-6-firebird
Add you database configuration in config/database.php
'connections' => [ 'myFirebirdConnection' => [ 'driver' => 'firebird', 'host' => env('DB_FIREBIRD_HOST', 'localhost'), 'port' => env('DB_FIREBIRD_PORT', '3050'), 'database' => env('DB_FIREBIRD_DATABASE', '/path_to/database.fdb'), 'username' => env('DB_FIREBIRD_USERNAME', 'SYSDBA'), 'password' => env('DB_FIREBIRD_PASSWORD', 'masterkey'), 'charset' => env('DB_FIREBIRD_CHARSET', 'UTF8'), ], // ... ],
Add the DB_FIREBIRD_* environment variables to your .env file, for example:
DB_FIREBIRD_HOST=192.168.0.1
DB_FIREBIRD_PORT=3050
DB_FIREBIRD_DATABASE=C:/DB.FDB
DB_FIREBIRD_USERNAME=user
DB_FIREBIRD_PASSWORD=password
DB_FIREBIRD_CHARSET=ISO-8859-2
Usage
Eloquent as model
To override your default database connection define $connection name in your Eloquent Model
/** * The connection name for the model. * * @var string */ protected $connection = 'myFirebirdConnection';
After defining connection name you can use it in normal way as you use Eloquent:
$user = User::where('id', 1)->get(); $users = User::all();
DB Query
Each time you have to define connection name (if it isn't your default one), for example:
$sql = 'SELECT * FROM USERS WHERE id = :id'; $bindings = ['id' => 1]; $user = DB::connection('myFirebirdConnection')->select($sql, $bindings); $users = DB::connection('myFirebirdConnection')->table('USERS')->select('*')->get();
kkszymanowski/laravel-6-firebird 适用场景与选型建议
kkszymanowski/laravel-6-firebird 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 20.03k 次下载、GitHub Stars 达 30, 最近一次更新时间为 2019 年 09 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 kkszymanowski/laravel-6-firebird 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kkszymanowski/laravel-6-firebird 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 20.03k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 30
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-27