kspitfire/pgsql-doctrine-round-function
Adds PostgreSQL ROUND() support to Doctrine ORM and DBAL. Register the custom DQL function to use ROUND in your queries with PostgreSQL, including numeric rounding with scale, without raw SQL. Lightweight and easy to configure in Symfony or plain Doctrine.
ROUND() into Doctrine DQL against PostgreSQL?" — and the answer remains "register a custom DQL function." Release 1.3 ("First stable & working") does not change the shape or size of that work; it confirms the code is now functional rather than introducing new capability. Treat it as a reference implementation (~30–60 lines of FunctionNode plus a Doctrine\ORM\Configuration registration), not a platform dependency.FunctionNode subclass plus a registration call, now with a known-good upstream example to crib from.Adoption criteria — all of these should hold before adding the dependency:
ROUND() inside DQL — i.e. in WHERE, ORDER BY, or SELECT expressions that must execute in the database rather than after hydration.FunctionNode API compatibility explicitly rather than assuming 1.3 addresses it — the release note claims stability, not currency.Look elsewhere (or build in-house) when:
DB::raw('ROUND(...)') or a select expression; close the ticket.ROUND(). If you are accumulating custom DQL functions (date truncation, GREATEST, string aggregation, window functions), adopt a maintained, cohesive custom-function library rather than assembling one micro-package per function.FunctionNode yourself (roughly 30–60 lines), cover it with an integration test against Postgres, and keep it in your own codebase. The MIT-licensed 1.3 source is a usable starting point if you want a reference.For executives: We re-reviewed a small open-source component that adds a ROUND() database function for Postgres-backed Doctrine queries. It has just shipped its first stable release (1.3), which is a positive signal, but a single release with a one-line note — following a long gap and implying earlier versions did not work — is not evidence of sustained maintenance. Recommendation unchanged: do not adopt as a dependency. The capability is a few dozen lines we can own outright. Taking it on adds an unsupported external dependency and a Postgres-only coupling to our data layer in exchange for saving perhaps half a day. The strategic takeaway is that our dependency-vetting threshold is working: small gaps like this should be closed in-house, and a single "first stable" release is not by itself grounds for reclassification.
For engineering: This is a Doctrine DQL custom function registering ROUND() for PostgreSQL — a FunctionNode subclass plus a Configuration::addCustomNumericFunction call. Two constraints before anyone reaches for it: it is Doctrine ORM only (irrelevant to Eloquent), and its release history gives no evidence of Doctrine ORM 3.x compatibility, so verify before assuming. Version 1.3 is described only as "First stable & working," with no changelog, so treat that as a functional baseline rather than a compatibility guarantee. The action item is a short spike: implement ROUND() as an internal FunctionNode with an integration test against Postgres, using 1.3 as a reference if useful. Decision to record: whether numeric rounding belongs in SQL or in the application layer — SQL for aggregation-heavy reports and cross-consumer consistency, PHP for database portability and easier unit testing. Do not add the Composer dependency.
How can I help you explore Laravel packages today?