sprintf/doctrine-datetime-bundle
A Symfony bundle that adds Doctrine DBAL datetime types and integration helpers, making it easier to map PHP DateTime values to database columns consistently. It wires custom types into Doctrine configuration so date and time handling stays predictable across entities.
date, datetime, and daterange columns into Doctrine entities. That directly enables product surfaces like resource booking, rental periods, subscription/validity windows, blackout dates, and pricing calendars where a half-open date interval is the natural domain model.DATE columns with app-level overlap checks, or use native Postgres ranges with exclusion constraints. The package is a candidate implementation of the latter; the decision itself should be made on correctness and query performance, not on this library.daterange plus a EXCLUDE USING gist constraint is the cleanest way to make double-booking structurally impossible. If "we occasionally double-book" is a known support pain point, this is the lever — and it justifies a small, deliberate investment rather than an ad-hoc fix.Sprint-F.RU) with no downstream consumers is a supply-chain and bus-factor question that should go through whatever dependency-review process you have — the answer is likely "no" for anything customer-facing.Consider it only if all of the following hold:
daterange (or date/datetime mapping quirks) as a first-class entity field, typically to pair with GiST exclusion constraints.Look elsewhere — or build — if any of these apply:
tsrange, tstzrange, int4range, numrange, multiranges, arrays, JSONB, citext). Prefer a maintained library such as martin-georgiev/postgresql-for-doctrine, or Doctrine's own custom-type mechanism.For executives (30 seconds): We evaluated a small open-source Symfony add-on that lets our database enforce date-range rules — for example, preventing two bookings from overlapping on the same resource. The underlying idea is sound and directly supports scheduling and subscription features. The package itself, however, has essentially no adoption and a single maintainer, so I do not recommend taking it as a dependency. Recommendation: spend roughly one to two engineering days writing a small in-house equivalent, or adopt a well-maintained Postgres-types library. Cost is negligible either way; the payoff is that double-booking becomes structurally impossible rather than a bug we fix after the fact.
For engineering: The repo is a thin Symfony bundle registering Doctrine DBAL custom types for Postgres date, datetime, and daterange. It is MIT-licensed and small enough to read in an afternoon, which makes it a useful reference for the type-conversion and bundle-registration pattern. It is not a safe dependency: one star, zero dependents, unclear Doctrine 3/4 and PHP 8.x support, and no visible maintenance cadence. Proposal: use it as a design reference and vendor a minimal daterange type plus a GiST exclusion migration into our own codebase, where we control the upgrade path. If we'd rather not own it, martin-georgiev/postgresql-for-doctrine covers this and more with real community backing — that's the option I'd put in front of architecture review alongside the build estimate.
Ask: Approve a timeboxed spike (1–2 days) to prototype the daterange + exclusion-constraint path on a non-critical table, and defer the build-vs-adopt decision until we have a working migration and a query benchmark.
How can I help you explore Laravel packages today?