PHPackages                             scrawler/swoole-postgresql-doctrine - 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. [Database &amp; ORM](/categories/database)
4. /
5. scrawler/swoole-postgresql-doctrine

ActiveLibrary[Database &amp; ORM](/categories/database)

scrawler/swoole-postgresql-doctrine
===================================

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

1.1.1(4y ago)27691[1 issues](https://github.com/scrawler-labs/swoole-postgresql-doctrine/issues)[5 PRs](https://github.com/scrawler-labs/swoole-postgresql-doctrine/pulls)MITPHPPHP ^7.4|^8.0

Since Nov 5Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/scrawler-labs/swoole-postgresql-doctrine)[ Packagist](https://packagist.org/packages/scrawler/swoole-postgresql-doctrine)[ RSS](/packages/scrawler-swoole-postgresql-doctrine/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (9)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`. Requires ext-openswoole 4.7.1 or higher

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

[](#getting-started)

### Install

[](#install)

```
composer require scrawler/swoole-postgresql-doctrine
```

### 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' => 'postgres',
    'user' => 'postgres',
    'password' => 'postgres',
    'host' => 'db',
    'driverClass' =>\Scrawler\Swoole\PostgreSQL\Driver::class,
    'poolSize' => 8,
];

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

#### 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, pg_sleep(1)')->fetchOne();
        $wg->done();
    });

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

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

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

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

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

### Credits

[](#credits)

This Project has been possible because of

All improvements have been added to the orignal repo too , chech this [PR https://github.com/leocavalcante/swoole-postgresql-doctrine-driver/pull/2](https://github.com/leocavalcante/swoole-postgresql-doctrine-driver/pull/2)

###  Health Score

38

—

LowBetter than 84% of packages

Maintenance55

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 76.9% 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.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

1643d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7247fc69a537df786db0d4e060054491e670b13f942366d93e186d4a765f8603?d=identicon)[physcocode](/maintainers/physcocode)

---

Top Contributors

[![leocavalcante](https://avatars.githubusercontent.com/u/183722?v=4)](https://github.com/leocavalcante "leocavalcante (10 commits)")[![renovate-bot](https://avatars.githubusercontent.com/u/25180681?v=4)](https://github.com/renovate-bot "renovate-bot (3 commits)")

---

Tags

doctrineopenswoolepostgresqlswoole

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/scrawler-swoole-postgresql-doctrine/health.svg)

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

###  Alternatives

[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58523.9M35](/packages/scienta-doctrine-json-functions)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4485.3M4](/packages/martin-georgiev-postgresql-for-doctrine)[damienharper/auditor-bundle

Integrate auditor library in your Symfony projects.

4542.8M](/packages/damienharper-auditor-bundle)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)[worksome/foggy

Foggy is a tool for making database dumps with some data removed/changed.

26571.7k1](/packages/worksome-foggy)

PHPackages © 2026

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