{"id":15295218,"url":"https://github.com/hyperf/database-pgsql-incubator","last_synced_at":"2025-10-07T06:31:38.106Z","repository":{"id":37346423,"uuid":"460367330","full_name":"hyperf/database-pgsql-incubator","owner":"hyperf","description":null,"archived":true,"fork":false,"pushed_at":"2022-12-14T07:24:11.000Z","size":79,"stargazers_count":13,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-16T14:47:00.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-17T09:32:53.000Z","updated_at":"2024-03-28T02:12:02.000Z","dependencies_parsed_at":"2022-08-08T20:01:14.319Z","dependency_job_id":null,"html_url":"https://github.com/hyperf/database-pgsql-incubator","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf%2Fdatabase-pgsql-incubator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf%2Fdatabase-pgsql-incubator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf%2Fdatabase-pgsql-incubator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperf%2Fdatabase-pgsql-incubator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperf","download_url":"https://codeload.github.com/hyperf/database-pgsql-incubator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235600027,"owners_count":19016192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-30T17:09:04.692Z","updated_at":"2025-10-07T06:31:32.763Z","avatar_url":"https://github.com/hyperf.png","language":"PHP","readme":"# PgSQL driver for Hyperf Database Component\n\n## 安装\n\n\u003e hyperf/database 组件版本必须大于等于 v2.2.26\n\n```\ncomposer require hyperf/database-pgsql-incubator\n```\n\n## 配置\n\n修改 `autoload/database.php` 配置\n\n```php\n\u003c?php\n\nreturn [\n    'pgsql' =\u003e [\n        'driver' =\u003e 'pgsql',\n        'host' =\u003e '127.0.0.1',\n        'database' =\u003e 'hyperf',\n        'port' =\u003e 5435,\n        'username' =\u003e 'postgres',\n        'password' =\u003e \"\",\n        'charset' =\u003e env('DB_CHARSET', 'utf8'),\n        'collation' =\u003e env('DB_COLLATION', 'utf8_unicode_ci'),\n        'prefix' =\u003e '',\n        'schema' =\u003e 'public',\n        'pool' =\u003e [\n            'min_connections' =\u003e 1,\n            'max_connections' =\u003e 10,\n            'connect_timeout' =\u003e 10.0,\n            'wait_timeout' =\u003e 3.0,\n            'heartbeat' =\u003e -1,\n            'max_idle_time' =\u003e (float) env('DB_MAX_IDLE_TIME', 60),\n        ],\n        'commands' =\u003e [\n            'gen:model' =\u003e [\n                'path' =\u003e 'app/Model',\n                'force_casts' =\u003e false,\n                'inheritance' =\u003e 'Model',\n                'refresh_fillable' =\u003e true\n            ],\n        ],\n    ],\n    'pgsql-swoole' =\u003e [\n        'driver' =\u003e 'pgsql-swoole',\n        'host' =\u003e '127.0.0.1',\n        'database' =\u003e 'hyperf',\n        'port' =\u003e 5435,\n        'username' =\u003e 'postgres',\n        'password' =\u003e \"\",\n        'charset' =\u003e env('DB_CHARSET', 'utf8'),\n        'collation' =\u003e env('DB_COLLATION', 'utf8_unicode_ci'),\n        'prefix' =\u003e '',\n        'schema' =\u003e 'public',\n        'pool' =\u003e [\n            'min_connections' =\u003e 1,\n            'max_connections' =\u003e 10,\n            'connect_timeout' =\u003e 10.0,\n            'wait_timeout' =\u003e 3.0,\n            'heartbeat' =\u003e -1,\n            'max_idle_time' =\u003e (float) env('DB_MAX_IDLE_TIME', 60),\n        ],\n        'commands' =\u003e [\n            'gen:model' =\u003e [\n                'path' =\u003e 'app/Model',\n                'force_casts' =\u003e false,\n                'inheritance' =\u003e 'Model',\n                'refresh_fillable' =\u003e true\n            ],\n        ],\n    ],\n];\n\n```\n\n## 使用\n\n目前增删改查orm，支持了pdo_pgsql和swoole/ext-postgresql双支持，由driver区分。迁移功能目前仅支持pdo，请注意配置和你的驱动是否安装\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperf%2Fdatabase-pgsql-incubator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperf%2Fdatabase-pgsql-incubator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperf%2Fdatabase-pgsql-incubator/lists"}