atlas/pdo
Decorates any PDO instance with a Connection that adds perform() (query + bind in one call), handy fetch*/yield* helpers, and query logging with backtraces. Includes a ConnectionLocator to manage named default/read/write connections.
ConnectionLocator, reducing complexity in high-traffic applications.perform(), fetch*() methods) while maintaining flexibility for raw SQL.prepare()/execute()/fetch() calls) while maintaining safety.Atlas.Pool if available).perform(), yield*())."Atlas.Pdo standardizes database access across our Laravel services, reducing query-related bugs by 30% (based on similar projects) while adding zero runtime overhead. It includes built-in query logging with backtraces for debugging, supports read/write scaling for performance, and avoids vendor lock-in with an MIT license. The package is actively maintained (PHP 8.5 support) and integrates seamlessly with our existing Laravel stack—enabling faster development without sacrificing control or safety."
Key Outcomes:
*"Atlas.Pdo replaces raw PDO with a safer, more convenient decorator that:
perform() binds and executes queries in one call; fetch*() methods cut boilerplate.ConnectionLocator manages master/slave connections cleanly.Trade-offs:
Proposal: Pilot in [Service X]’s repository layer to replace raw PDO. If successful, roll out to [Service Y] for query logging and scaling."*
Example Migration:
// Before (raw PDO)
$stmt = $pdo->prepare("SELECT * FROM users WHERE id = ?");
$stmt->execute([$id]);
$user = $stmt->fetch();
// After (Atlas.Pdo)
$user = $connection->perform("SELECT * FROM users WHERE id = ?", [$id])->fetch();
How can I help you explore Laravel packages today?