megawilddaddy/simple-pdo-query-builder
A lightweight, simple PDO query builder for PHP that lets you construct and execute SQL queries through a clean, chainable API. Great for small projects that need straightforward database access without the overhead of a full ORM.
Architecture fit
Illuminate integration. It sits beside the framework rather than inside its container, which is a poor architectural fit for a Laravel codebase that already has Illuminate\Database (query builder, Eloquent, connection pooling, read/write splitting, transaction management).DB::connection()->getPdo() plus DB::select()/statement(), and with the framework's own query builder, which already delivers "low-level SQL generation with ease" while staying container-aware and event-aware.illuminate/database is considered overweight. That is an architecture decision driven by bundle size, not by capability.Integration feasibility
Technical risk
IN () expansion, identifier quoting/escaping, nested transactions and savepoints, PDO::ATTR_ERRMODE handling, and whether it silently swallows or rethrows PDOException.Key questions
PDO::prepare/bindValue, or is any user input concatenated into SQL? Can we get a written answer plus a code walkthrough?composer.json PHP constraint, and does it install and pass a smoke test on our current PHP runtime and CI matrix?PDO handle) that would conflict with Laravel's connection manager and its transaction semantics?DB::select() / the query builder does not? If we cannot name one in a sentence, the answer is "none."Stack fit
config/database.php, framework transaction helpers, and query logging/listeners. Introducing it creates a second, parallel database access path with different semantics — a durable source of subtle bugs (nested transaction mismatch, connection-count drift, inconsistent logging).Migration path
DB::select(), DB::statement(), and DB::transaction() for raw SQL, and the query builder for anything composable. This satisfies the stated need with zero new dependencies and full framework guarantees.Compatibility
PDO::ERRMODE_EXCEPTION, since Laravel configures exceptions and any code that assumes silent failure modes will behave differently here.Sequencing
IN clause, transaction rollback, error path).DB:: primitives) as the approved pattern.Maintenance
Support
Scaling
Failure modes
PDO handle: writes outside DB::transaction() are not rolled back with the rest of the request, producing partially committed state that is hard to reproduce.Ramp-up
How can I help you explore Laravel packages today?