承接 hyperf/database-pgsql-incubator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 14
  • Watchers: 4
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-21