PHPackages                             pfilsx/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. pfilsx/postgresql-doctrine

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

pfilsx/postgresql-doctrine
==========================

Extended Doctrine DBAL and Doctrine migrations classes for postgresql specific features support

v1.10.0(1y ago)33.4k↓29.1%11MITPHPPHP ^8.1

Since Dec 18Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/pfilsx/PostgreSQLDoctrine)[ Packagist](https://packagist.org/packages/pfilsx/postgresql-doctrine)[ RSS](/packages/pfilsx-postgresql-doctrine/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (8)Versions (26)Used By (1)

PostgreSQL Doctrine
===================

[](#postgresql-doctrine)

[![Packagist Version](https://camo.githubusercontent.com/f3d9b8ea37b10ecb7278c8c3637f186a007c1ea401827c61073696f77c76e125/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7066696c73782f706f737467726573716c2d646f637472696e653f6c6162656c3d6c6174657374253230737461626c65)](https://camo.githubusercontent.com/f3d9b8ea37b10ecb7278c8c3637f186a007c1ea401827c61073696f77c76e125/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7066696c73782f706f737467726573716c2d646f637472696e653f6c6162656c3d6c6174657374253230737461626c65)[![Packagist Dependency Version](https://camo.githubusercontent.com/58bf9410f4ecf28acd6098e55928e7aa047fc77761b6bb7ae0033504353fc049/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f7066696c73782f706f737467726573716c2d646f637472696e652f706870)](https://camo.githubusercontent.com/58bf9410f4ecf28acd6098e55928e7aa047fc77761b6bb7ae0033504353fc049/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f7066696c73782f706f737467726573716c2d646f637472696e652f706870)[![Packagist Downloads](https://camo.githubusercontent.com/4c9a24d51b06f544acae27ca9b71a39af2ebd685e3f04799ccdc541e7323f223/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7066696c73782f706f737467726573716c2d646f637472696e653f636f6c6f723d303337356236)](https://camo.githubusercontent.com/4c9a24d51b06f544acae27ca9b71a39af2ebd685e3f04799ccdc541e7323f223/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7066696c73782f706f737467726573716c2d646f637472696e653f636f6c6f723d303337356236)

Description
-----------

[](#description)

Provides extended Doctrine and Doctrine migrations PostgreSQL support with specific features such as [enums](https://www.postgresql.org/docs/current/datatype-enum.html), arrays and aggregate and JSON(B) functions.

Features
--------

[](#features)

- PostgreSQL enums support in DBAL, ORM and migrations
- PHP8 enum support
- Fix creating [default schema in down migrations for pgsql](https://github.com/doctrine/dbal/issues/1110)
- [JSON(B) functions](https://www.postgresql.org/docs/current/functions-json.html) (in progress)
- JSON(B) types based on object models (in progress, requires symfony/serializer)
- [Trait](src/ORM/Trait/ExistsMethodRepositoryTrait.php) for easy use of [SELECT EXISTS(...)](https://www.postgresql.org/docs/current/functions-subquery.html#FUNCTIONS-SUBQUERY-EXISTS) in your entity repositories
- Aggregate functions with filter condition support
- Array types
- [Text Search](https://www.postgresql.org/docs/current/textsearch.html) support

Requirement
-----------

[](#requirement)

- PHP ^8.1
- doctrine/dbal ^3.5.1
- doctrine/migrations ^3.5.2
- symfony/serializer &gt;=5.4.\* (optional for json models)
- symfony/property-info &gt;=5.4.\* (optional for json models)

Installation
------------

[](#installation)

Open a command console, enter your project directory and execute the following command to download the latest version of this bundle:

```
composer require pfilsx/postgresql-doctrine
```

Usage
-----

[](#usage)

Please refer [Doctrine DBAL](https://www.doctrine-project.org/projects/doctrine-dbal/en/current/index.html)and [Doctrine Migrations](https://www.doctrine-project.org/projects/doctrine-migrations/en/3.5/index.html)for instructions on how to override the default doctrine classes in your project.

Required steps:

1. Register [PostgreSQLDriverMiddleware.php](src/DBAL/Middleware/PostgreSQLDriverMiddleware.php) as driver middleware
2. Register [OrmSchemaProvider.php](src/Migrations/Provider/OrmSchemaProvider.php) as Doctrine\\Migrations\\Provider\\SchemaProvider in Doctrine\\Migrations\\DependencyFactory
3. Register types and functions on your needs

For Symfony integration see [PostgreSQLDoctrineBundle](https://github.com/pfilsx/PostgreSQLDoctrineBundle)

Documentation
-------------

[](#documentation)

- [Enums](docs/Enums.md)
- [Functions](docs/Functions-and-Operators.md)
- [Types](docs/Types.md)

License
-------

[](#license)

This bundle is released under the MIT license.

###  Health Score

43

—

FairBetter than 90% of packages

Maintenance55

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 98.2% 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 ~38 days

Recently: every ~177 days

Total

24

Last Release

395d ago

Major Versions

v0.0.1 → v1.0.02022-12-19

PHP version history (2 changes)v0.0.1PHP ^7.4

v1.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a454338d7c66e09ecdccd0f29802a3d7cca1498617cab6166285cad547c3734?d=identicon)[Pfilsx](/maintainers/Pfilsx)

---

Top Contributors

[![pfilsx](https://avatars.githubusercontent.com/u/29336048?v=4)](https://github.com/pfilsx "pfilsx (56 commits)")[![KojoEnch](https://avatars.githubusercontent.com/u/49156789?v=4)](https://github.com/KojoEnch "KojoEnch (1 commits)")

---

Tags

arraysdoctrinedoctrine-dbaldoctrine-migrationsdoctrine-ormenumsjson-modeljsonbpostgresqlenumdoctrinepostgresqlmigrationsdoctrine-migrationsphp8doctrine-dbal

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[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.

4535.7M4](/packages/martin-georgiev-postgresql-for-doctrine)[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4627.0M12](/packages/fresh-doctrine-enum-bundle)[scienta/doctrine-json-functions

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

58725.2M48](/packages/scienta-doctrine-json-functions)[laravel-doctrine/migrations

Doctrine Migrations for Laravel

782.8M17](/packages/laravel-doctrine-migrations)[umbrellio/laravel-pg-extensions

Extensions for Postgres Laravel

102443.2k1](/packages/umbrellio-laravel-pg-extensions)[flow-php/doctrine-dbal-bulk

Bulk inserts and updates for Doctrine DBAL

14361.1k3](/packages/flow-php-doctrine-dbal-bulk)

PHPackages © 2026

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