efureev/swoole-doctrine-dbal-pgsql-driver

The Postgres Swoole 5 driver for Doctrine

Maintainers

👁 efureev

Package info

github.com/efureev/swoole-doctrine-dbal-pgsql-driver

pkg:composer/efureev/swoole-doctrine-dbal-pgsql-driver

Statistics

Installs: 8 149

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v2.1.4 2026-03-10 09:37 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 13bba1f4b9f08872b2498270e8394b5ab4bfd133

  • Fureev Eugene <fureev.woop@gmail.com>

dbalsymfonyswooledocrtine

This package is auto-updated.

Last update: 2026-06-10 10:15:30 UTC


README

Doctrine DBAL Driver for Swoole 5 Postgresql database connections

Installation

The easiest way to install this package is through composer:

$ composer require efureev/swoole-doctrine-dbal-pgsql-driver

Example

You can test functionality using supplied docker image, located in example folder. Cli example can be found in example/cli.php. HTTP server example can be found in example/server.php

App Config:

doctrine:
 dbal:
 default_connection: 'swoole'
 connections:
 swoole:
 dbname: '%env(DB_MASTER_NAME)%'
 host: '%env(DB_MASTER_HOST)%'
 port: '%env(DB_MASTER_PORT)%'
 user: '%env(DB_MASTER_USER)%'
 password: '%env(DB_MASTER_PASS)%'
 driver_class: 'Swoole\Packages\Doctrine\DBAL\PgSQL\Driver'
 server_version: '15'
 options:
 poolSize: 3 # MAX count connections in one pool
 usedTimes: 3 # 1 connection (in pool) will be re-used maximum N queries
 connectionTTL: 60 # when connection not used this time(seconds) - it will be close (free)
 tickFrequency: 60000 # when need check possibilities downscale (close) opened connection to DB in pools
 connectionDelay: 2 # time(seconds) for waiting response from pool
 useConnectionPool: true # if false, will create new connect instead of using pool
 retryMaxAttempts: 2 # if connection in pool was timeout (before use) then try re-connect
 retryDelay: 1000 # delay to try fetch from pool again(milliseconds) if no connect available

Add Bundle to the bundles.php:

[
 SwooleDoctrineDbalPoolBundle::class => ['all' => true],
]

It's all.