aura/sqlquery
Database-agnostic SQL query builders for MySQL, PostgreSQL, SQLite, and SQL Server. Build SELECT/INSERT/UPDATE/DELETE statements safely and portably without tying to a specific DB library (PDO recommended). PSR-4, PHP 5.6+.
addRows() for multi-row inserts (reduces round-trips vs. per-row inserts).setPaging() recalculates LIMIT/OFFSET dynamically (useful for infinite scroll or large datasets).?-placeholders in nested queries (avoids SQL injection while enabling complex joins).:_#_) prevent SQL injection (critical for PCI/DSS, HIPAA compliance).getStatement()) accelerates onboarding.select()->where()->limit()) aligns with modern PHP frameworks.SELECT ... GROUP BY ... HAVING) without ORM overhead.*"Aura.SqlQuery lets us write database queries in PHP without vendor lock-in—like using SQL’s power without its complexity. It’s MIT-licensed, battle-tested across 4 major databases, and reduces tech debt by eliminating raw SQL strings. For example:
select()->from('users')->where('active', true)).*"This is a lightweight, dependency-free query builder that:
insert()->addRows([...]) for bulk inserts).WHERE/HAVING (e.g., correlated subqueries).ON DUPLICATE KEY UPDATE for MySQL (idempotent writes).addRows() call for 1000+ inserts (vs. 1000 round-trips).LIMIT/OFFSET for pagination (avoids OFFSET X performance pitfalls).
Tradeoff: No built-in migrations or schema tools (use Doctrine Migrations alongside).
Try it: Replace one raw SQL query in your app with Aura.SqlQuery—you’ll see the difference in readability and safety."*How can I help you explore Laravel packages today?