finds.dev← search

// the find

martin-georgiev/postgresql-for-doctrine

★ 459 · PHP · MIT · updated Sep 2026

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

A Doctrine DBAL/ORM extension that adds native mapping for PostgreSQL's non-standard types (arrays, JSONB, ranges, PostGIS geometries, ltree, hstore, citext, pgvector) plus DQL functions for 100+ PostgreSQL operators and functions. It's for teams running Doctrine on Postgres who are tired of raw SQL escape hatches or hand-rolled custom types every time they touch an array column or a tsvector.

The type coverage is genuinely deep, not just the common jsonb/array cases but multiranges, network types, composite/enum types, and even pgvector distance functions — someone clearly hit every one of these walls in production. It also actively patches Doctrine's own bugs rather than just wrapping them: the README calls out that DBAL 4.3's built-in jsonb type mangles integers past PHP_INT_MAX into floats, and overrides it. The CI setup is unusually rigorous for a library this size — custom PHPStan rules enforcing value-object immutability and naming conventions, deptrac for layer boundaries, jscpd for duplication, and integration tests that spin up real Postgres+PostGIS via docker-compose rather than mocking the driver.

It's a single-maintainer project (martin-georgiev) with 58 forks but no visible co-maintainers, so bus factor is a real concern for something this load-bearing in a data layer. Each type family drags in its own Postgres extension requirement (PostGIS, pgvector, hstore, pgx_ulid, citext), so a project using several of these ends up managing a stack of extension installs and version compatibility, not just a Composer dependency. The jsonb-override behavior mentioned in the README is a sign the library has to chase Doctrine's internals release to release — DBAL 4.x already shipped a conflicting native type, and future DBAL versions could easily break the override trick again. It's also fully coupled to Doctrine; there's no standalone use of these type conversions outside the ORM/DBAL stack.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →