sad_spirit/pg_wrapper
A modern, object-oriented wrapper around PHP's pgsql extension for PostgreSQL, offering connection management, parameterized queries, result iteration, automatic type conversion, and support for custom and async queries.
sad_spirit/pg_wrapper wraps PHP’s pgsql extension and provides conversion for complex PostgreSQL types. The best architectural fit is a targeted sidecar data-access path for bounded contexts that genuinely need arrays, ranges, composites, geometric types, custom PostgreSQL types, or precise pgsql result handling. It is a poor fit for replacing Eloquent/query-builder CRUD or for teams expecting a Laravel-native package.ext-pgsql availability in all environments, divergence between Laravel casts and package conversion, and maintainer/bus-factor exposure. BSD-2-Clause is permissive and low legal risk.ext-pgsql enabled? How will transactions spanning Eloquent and the wrapper be prohibited or reconciled? What PHP, Laravel, PostgreSQL, and ext-pgsql versions are supported? Who owns upgrades and incident response for a low-adoption dependency? Does it work with the team’s connection pooler, queue workers, and Laravel Octane lifecycle?pgsql DSN. Implement an adapter that exposes only the operations needed, then prove type conversion and error behavior with integration tests against the real PostgreSQL version. Expand only if the measured benefit is clear.ext-pgsql, PostgreSQL server version, and connection-pooler behavior before adoption. Map package-returned values against existing Eloquent casts and API contracts. Ensure local, CI, staging, and production images all enable the same extension and drivers. Avoid relying on the package for schema migrations, seeders, or Laravel database events.ext-pgsql installation, DSN configuration, type-conversion failures, and connection troubleshooting. Expect limited Stack Overflow or framework-specific guidance.pgsql connection outside Laravel’s normal PDO connection management. Account for extra connection counts, pooler compatibility, queue-worker reconnects, and Octane request lifecycle behavior. Avoid unbounded per-request connection creation and ensure connections are reused or closed deterministically.ext-pgsql, misconfigured DSNs, conversion errors on unsupported or custom types, transaction inconsistency between PDO and pgsql, stale connections in long-running workers, version skew after PHP/PostgreSQL upgrades, and silent differences between Laravel casts and package output. Instrument repository-level errors and conversion exceptions before broad rollout.ext-pgsql experience, not just Laravel/Eloquent knowledge. Budget a spike, paired implementation, documentation, and tests. Ramp-up is moderate for a narrow read-only repository; it is high if the package is positioned as a general database-access replacement.How can I help you explore Laravel packages today?