Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Postgresql Doctrine Laravel Package

pfilsx/postgresql-doctrine

Adds PostgreSQL-specific types, functions, and platform support to Doctrine DBAL, enabling native arrays, JSON/JSONB, hstore, and other rich Postgres features in your entities. A lightweight bridge for projects needing more than Doctrine's built-in Postgres support.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is not a Laravel package in the Eloquent sense; it is a Doctrine DBAL/ORM extension that adds PostgreSQL-specific DBAL types (ENUM, arrays, JSON/JSONB, geometric, network types) plus a Doctrine Migrations platform extension and SQL function emulation for aggregates and PG-native functions. It only fits stacks where Doctrine is the persistence layer — a minority pattern in Laravel (typical use is doctrine/dbal for schema introspection alongside Eloquent, or full Doctrine ORM integrations). In a Laravel codebase, the realistic value is narrow: schema introspection of an existing Postgres database that already uses native enums/arrays/JSONB, or teams that have standardized on Doctrine ORM (more common in Symfony and legacy/enterprise PHP). If the target codebase is Eloquent-native, this package solves a problem you don't have, and the correct move is to model those constructs as casts/columns rather than adopt it.

Integration feasibility. Low friction where Doctrine is already in place: register custom types in doctrine.yaml/config/doctrine.php, configure the migrations platform with the custom platform class, and existing entities/migrations pick up the types. Friction is high at the boundaries — every additional Doctrine package increases version pinning surface, and this package must track Doctrine DBAL's internal API (types, platform, schema manager) which changes across major versions.

Technical risk. The dominant risk is adoption and maintainership, not code quality: 3 stars, 0 dependents, single maintainer, one release to date. Mitigating factors: MIT license, small surface area, and the source is fully inspectable and forkable. The functional risk is version coupling to Doctrine DBAL (3.x vs 4.x schema APIs, platform class internals) and to PostgreSQL DDL semantics. The high opportunity score (12.84) with low overall score (0.045) signals a real capability gap in the ecosystem — Postgres-native features are poorly served by stock Doctrine — but an unmet-demand signal is not the same as a proven dependency.

Key questions to resolve before adoption.

  • Which Doctrine DBAL/ORM versions are pinned in the target app, and does this package's supported matrix overlap them?
  • Do we actually need DBAL-level awareness of ENUM/ARRAY/JSONB, or can we use raw SQL migrations plus Eloquent casts and avoid the dependency entirely?
  • Who owns the fork if upstream stalls? Is the code small enough to vendor?
  • Does the migrations platform extension correctly diff native Postgres constructs against Doctrine metadata, or does it require hand-written migrations for enums (a known weak spot in DBAL)?
  • Are there known serialization/round-trip bugs for arrays vs. jsonb that would surface as data corruption rather than an obvious failure?

Integration Approach

Stack fit. Adopt only if (a) Doctrine ORM is the persistence layer, and (b) the schema relies on Postgres-native types that stock Doctrine either fails to introspect or mangles during diff. Treat Eloquent-only Laravel apps as out of scope; the cheaper alternative there is raw DDL migrations and model casts.

Migration path.

  1. Pin the package to a specific tagged release; vendor or mirror it in your Composer repo so an upstream deletion doesn't break builds.
  2. Register the custom DBAL types and the migrations platform in the Doctrine config for a single non-production environment first.
  3. Run doctrine:schema:validate and a dry-run migrations:diff against a restored copy of a production schema to confirm the platform doesn't emit destructive or spurious diffs for enums, arrays, and JSONB.
  4. Only after diff parity is confirmed, replace hand-written DDL migrations with platform-generated ones; keep a rollback path that does not depend on the package.

Compatibility. Verify the supported Doctrine DBAL/ORM majors and the minimum PostgreSQL version (JSONB requires 9.4+; array and enum handling is stable across 11–16, but ALTER TYPE ... ADD VALUE transaction semantics differ and affect migration reversibility). Confirm PHP version constraints align with the rest of the stack, and check that the migrations bundle (doctrine/migrations) major aligns, since the platform-extension hook has changed version to version.

Sequencing. Because of the low adoption and zero dependents, sequence this as: proof-of-concept against a schema snapshot → internal fork/vendoring decision → non-production integration → production migration of one low-risk table → broader rollout. Do not make this a blocking dependency for a release train; it should be a background enabler. Budget for a one-time code review of the type converters, since there is no downstream base of users stress-testing edge cases.

Operational Impact

Maintenance. Expect to self-maintain. There is no vendor, no commercial support, and no community velocity behind 3 stars. Practical stance: fork under the organization, pin to the fork, and budget a small recurring allocation to rebase against Doctrine upgrades. The upside is the license permits this and the code surface is small.

Support. No SLA, no documented escalation path. Issues and PRs on the upstream repo may go unanswered. Internal documentation and a named owner are non-optional; without them this becomes tribal knowledge in one engineer's head.

Scaling. Type conversion is per-row serialization and is generally cheap for JSONB and small arrays, but large array columns and repeated round-trips through custom types add CPU and allocation overhead relative to native driver-level handling. The package pushes query work down to Postgres (aggregates, JSONB operators), which is the right scaling posture. Watch connection pool behavior if migration tooling runs inside app processes.

Failure modes.

  • Doctrine DBAL upgrade breaks the custom platform/type API — manifests as schema diffs that want to drop and recreate columns.
  • Enum changes during migrations produce lock contention on large tables; ALTER TYPE ADD VALUE inside a transaction is version-sensitive.
  • Serialization mismatch on array or JSONB columns silently corrupts values rather than erroring.
  • Missing diff support forces hand-written migrations, so the package's value degrades to "type casting only" — a much smaller win.
  • Repository abandonment or removal; mitigated by vendoring.

Ramp-up. Engineers need both Doctrine ORM fluency (unit of work, DBAL types, migrations platform hooks) and practical PostgreSQL DDL expertise (enums, array indexing, JSONB operators). That is a meaningful ramp for a team coming from Eloquent. Estimate a day or two to validate the integration and considerably longer to establish organizational confidence in a dependency with no downstream users. Given the risk profile, the honest recommendation is to treat this as a reference implementation to borrow from or vendor, not as a dependency to adopt wholesale.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource