hyperf/database-pgsql-incubator
最新稳定版本:v0.1.2
Composer 安装命令:
composer require hyperf/database-pgsql-incubator
包简介
A pgsql handler for hyperf/database.
README 文档
README
安装
hyperf/database 组件版本必须大于等于 v2.2.26
composer require hyperf/database-pgsql-incubator
配置
修改 autoload/database.php 配置
<?php return [ 'pgsql' => [ 'driver' => 'pgsql', 'host' => '127.0.0.1', 'database' => 'hyperf', 'port' => 5435, 'username' => 'postgres', 'password' => "", 'charset' => env('DB_CHARSET', 'utf8'), 'collation' => env('DB_COLLATION', 'utf8_unicode_ci'), 'prefix' => '', 'schema' => 'public', 'pool' => [ 'min_connections' => 1, 'max_connections' => 10, 'connect_timeout' => 10.0, 'wait_timeout' => 3.0, 'heartbeat' => -1, 'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60), ], 'commands' => [ 'gen:model' => [ 'path' => 'app/Model', 'force_casts' => false, 'inheritance' => 'Model', 'refresh_fillable' => true ], ], ], 'pgsql-swoole' => [ 'driver' => 'pgsql-swoole', 'host' => '127.0.0.1', 'database' => 'hyperf', 'port' => 5435, 'username' => 'postgres', 'password' => "", 'charset' => env('DB_CHARSET', 'utf8'), 'collation' => env('DB_COLLATION', 'utf8_unicode_ci'), 'prefix' => '', 'schema' => 'public', 'pool' => [ 'min_connections' => 1, 'max_connections' => 10, 'connect_timeout' => 10.0, 'wait_timeout' => 3.0, 'heartbeat' => -1, 'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60), ], 'commands' => [ 'gen:model' => [ 'path' => 'app/Model', 'force_casts' => false, 'inheritance' => 'Model', 'refresh_fillable' => true ], ], ], ];
使用
目前增删改查orm,支持了pdo_pgsql和swoole/ext-postgresql双支持,由driver区分。迁移功能目前仅支持pdo,请注意配置和你的驱动是否安装
统计信息
- 总下载量: 29.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-21