soluble/dbwrapper
Soluble DbWrapper provides a lightweight, fluent wrapper around Laravel’s database layer, simplifying common query and persistence tasks while keeping familiar Query Builder conventions. It helps reduce boilerplate for CRUD, filtering, and reusable database logic in PHP applications.
Architecture fit. soluble/dbwrapper is a framework-agnostic, minimalist PDO abstraction (multi-driver: MySQL/PostgreSQL/SQLite/SQL Server) with a thin, procedural-style API. It has no Laravel idioms: no ServiceProvider, no Facade, no publishable config, no Eloquent or Query Builder integration, no migration/transaction helpers aligned with Laravel's contracts. Inside a Laravel application this creates a parallel data-access path alongside Illuminate\Database, which is an architectural anti-pattern: two connection lifecycles, two error-handling models, two logging surfaces, and two mental models for engineers. Its legitimate fit is narrow — a bounded legacy module, a CLI/worker, or a non-Laravel microservice sharing a monorepo.
Integration feasibility. Composer-installable, MIT-licensed, small surface area — mechanically easy to require. The blockers are non-mechanical:
php: ^7.x. Laravel 10/11 require PHP 8.1/8.2+, so composer require will likely fail resolution. Adoption realistically means forking to relax the PHP constraint and adding PHP 8 return types/deprecation fixes.config/database.php credentials/driver options into the wrapper's config object and register a singleton with correct lifecycle semantics.Technical risk. Rated Low quality (score 0.135) with 7 stars and 0 dependents: essentially zero ecosystem validation and a single-maintainer bus factor. Last release January 2019 means no PHP 8 hardening, no security patch cadence, and no upstream responsiveness to a CVE. Countervailing: the dependency chain is shallow (PDO/Doctrine DBAL) and PDO semantics are stable, so runtime risk is moderate rather than severe — the dominant risk is abandonment, i.e., we inherit maintenance. Test coverage and CI matrix are unverifiable from the outside; treat as untested on our runtime until proven.
Key questions.
DB::connection()->getPdo() or a ~150-line internal PDO wrapper does not?Stack fit. Poor as a primary data layer; acceptable only as an isolated adapter behind an internal contract. Recommendation: do not adopt as a general dependency. If a specific legacy component needs it, confine it to one bounded context and forbid its use in new code via a lint/review rule.
Migration path. Interface-first, exit-first:
DatabaseAdapter contract (query, fetch, insert/update/delete, transaction).soluble/dbwrapper and over Laravel's DB facade, so the wrapper is swappable by config.ServiceProvider; map config/database.php into the wrapper's config DTO.Compatibility. Pin an exact version; if forking, tag an internal 1.x-internal and register it as a VCS/private path repository. Verify ext-pdo plus the specific driver extensions in our base images. Check Doctrine DBAL version alignment against the rest of the lockfile before committing — this is the most likely silent conflict.
Sequencing (≈2 weeks elapsed, ~5–7 engineer-days).
Maintenance. Effectively unmaintained upstream — the moment we ship it, we own it. Budget a named owner and roughly 10–15% of one engineer's capacity for PHP upgrades, dependency bumps, and security triage. Without a fork and CI, the package will silently fail the next PHP minor upgrade. Compare cost honestly: a fork + CI + audit is ~3–5 engineer-days; an internal PDO wrapper with full ownership is ~2–3 days. The wrapper is usually the cheaper path.
Support. No vendor, no community (7 stars, 0 dependents), documentation limited to a README and a stale docs site. All support is internal L1/L2. Onboarding friction is real: new engineers know Laravel's DB layer, not this, so every incident in that module has a slower first responder. Mitigate with a short runbook and a "do not extend" banner in the README.
Scaling. Throughput is essentially PDO throughput — no ORM overhead, so raw performance is fine and not a concern. What's absent is everything around the query: no connection pooling, read/write splitting, lazy connections, retry/backoff, or query instrumentation. Those must be layered by us or accepted as gaps. Under Octane/queue workers, unproven reconnect behavior is the main scaling hazard.
Failure modes.
Ramp-up. The API surface is small: a mid-level PHP developer is productive in ~1–2 days. Budget an additional sprint-equivalent of edge-case hardening and test-writing, because the risk here is not learning the API — it's discovering undocumented behavior in production.
How can I help you explore Laravel packages today?