PHPackages                             matrix2305/swoole-pgslq-doctrine-driver - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. matrix2305/swoole-pgslq-doctrine-driver

ActiveLibrary

matrix2305/swoole-pgslq-doctrine-driver
=======================================

A Doctrine DBAL Driver implementation on top of Swoole Coroutine PostgreSql extension

00PHP

Since May 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/matrix2305/swoole-pgsql-doctrine-driver)[ Packagist](https://packagist.org/packages/matrix2305/swoole-pgslq-doctrine-driver)[ RSS](/packages/matrix2305-swoole-pgslq-doctrine-driver/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Swoole Coroutine PostgreSQL Doctrine DBAL Driver
================================================

[](#swoole-coroutine-postgresql-doctrine-dbal-driver)

A `Doctrine\DBAL\Driver` implementation on top of `Swoole\Coroutine\PostgreSQL`.

Getting started
---------------

[](#getting-started)

### Install

[](#install)

```
composer require matrix2305/swoole-pgsql-doctrine-driver
```

### Usage

[](#usage)

Doctrine parameters, for both DBAL and ORM projects, accepts the `driverClass` option; it is where we can inject this project's driver:

```
use Doctrine\DBAL\{Driver, DriverManager};

$params = [
    'dbname' => 'mysql',
    'user' => 'mysql',
    'password' => 'mysql',
    'host' => 'db',
    'driverClass' => Driver\Swoole\Coroutine\PgSQL\Driver::class,
    'poolSize' => 8,
];

$conn = DriverManager::getConnection($params);
```

*Yes, I deliberately used the `Doctrine\DBAL\Driver` namespace + `Swoole\Coroutine\MySQL` namespace, so it is not confusing.*

#### You are ready to rock inside Coroutines (Fibers):

[](#you-are-ready-to-rock-inside-coroutines-fibers)

```
Co\run(static function() use ($conn): void {
    $results = [];
    $wg = new Co\WaitGroup();
    $start_time = time();

    Co::create(static function() use (&$results, $wg, $conn): void {
        $wg->add();
        $results[] = $conn->executeQuery('select 1, sleep(1)')->fetchOne();
        $wg->done();
    });

    Co::create(static function() use (&$results, $wg, $conn): void {
        $wg->add();
        $results[] = $conn->executeQuery('select 1, sleep(1)')->fetchOne();
        $wg->done();
    });

    $wg->wait();
    $elapsed = time() - $start_time;
    $sum = array_sum($results);

    echo "Two sleep(1) queries in $elapsed second, returning: $sum\n";
});
```

You should be seeing `Two sleep(1) queries in 1 second, returning: 2` and the total time should **not** be 2 (the sum of `sleep(1)`'s) because they ran concurrently.

```
real    0m1.228s
user    0m0.036s
sys     0m0.027s
```

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/10d069e47ef621e2f7348facfc7e181925b2d0906a554dd6f4caa69ecdb8e0a8?d=identicon)[matrix2305](/maintainers/matrix2305)

---

Top Contributors

[![matrix2305](https://avatars.githubusercontent.com/u/62420807?v=4)](https://github.com/matrix2305 "matrix2305 (2 commits)")

### Embed Badge

![Health badge](/badges/matrix2305-swoole-pgslq-doctrine-driver/health.svg)

```
[![Health](https://phpackages.com/badges/matrix2305-swoole-pgslq-doctrine-driver/health.svg)](https://phpackages.com/packages/matrix2305-swoole-pgslq-doctrine-driver)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
