martin-georgiev/postgresql-for-doctrine
Adds PostgreSQL-specific power to Doctrine DBAL/ORM: rich native types (jsonb, arrays, ranges, network, geometric, etc.) plus DQL functions/operators for JSON and array querying. Supports PostgreSQL 9.4+ and PHP 8.2+.
Feature Expansion for PostgreSQL-Centric Applications:
JSONB, PostGIS, ltree, uuid) in Laravel/Lumen applications, reducing the need for custom ORM layers or raw SQL.spatie/laravel-postgis.ltree, arrays of JSON, or ranges) without sacrificing type safety or query performance.Roadmap: Migrate from MySQL to PostgreSQL:
Build vs. Buy:
JsonbArray, Geometry handlers) and leverages a battle-tested, MIT-licensed solution.Use Cases:
JSONB operations (e.g., ->, #>>) are critical.ltree.citext for case-insensitive tenant identifiers or hstore for dynamic schema extensions.Adopt This Package If:
JSONB, ltree) without raw SQL.bytea ↔ PHP resources, uuid ↔ Ramsey\Uuid).ST_Distance, to_tsvector, array_agg) without writing custom query builders.Look Elsewhere If:
"This package lets us fully leverage PostgreSQL’s power—like geospatial queries for our logistics app or nested JSON for our analytics dashboard—without rewriting our data layer. It’s a drop-in solution that reduces technical debt by standardizing how we handle PostgreSQL-specific types (e.g., PostGIS geometries, UUIDs) through Laravel’s existing Doctrine integration. For example, we can now query ‘find all rides within 5km of this point’ using native PostGIS functions in DQL, cutting development time by 30% compared to custom SQL. The MIT license and active community make it a low-risk choice."
*"This extends Laravel’s Doctrine layer to support PostgreSQL’s advanced types (e.g., JSONB, PostGIS, ltree) with first-class DQL integration. Key benefits:
ST_Distance or array_agg directly in queries.bytea ↔ resources, uuid ↔ Ramsey\Uuid).pgvector for similarity search.Trade-offs:
doctrine/dbal and illuminate/database.Recommendation: Pilot this for our geospatial module first—it’ll cut query complexity and improve maintainability."*
How can I help you explore Laravel packages today?