atlas/statement
Atlas.Statement provides portable SQL statement builders for MySQL, PostgreSQL, SQLite, and SQL Server. Connection-independent and works well with PDO, Atlas.Query, and Atlas.Pdo to build queries safely and consistently across databases.
Strengths:
Select::from()->where()->join()), mirroring Laravel’s fluent query builder but with stricter type safety and method chaining.Gaps:
whereRaw, orWhere, having, or raw expression syntax). Would require wrapper methods or manual SQL injection.groupBy, having) exist but may not cover all Laravel Query Builder use cases (e.g., window functions).DB::table() for complex queries, especially where type safety or method chaining is desired.// Current Laravel
User::where('active', true)->limit(10);
// Atlas Alternative
Select::from('users')
->whereEquals(['active' => true])
->limit(10);
INSERT, UPDATE, or DELETE statements in custom migration logic.whereEquals() vs. where()).whereIn with variable arrays).NULL values, subqueries).DB::table() for new projects or feature development. Use Atlas for:
JOIN/GROUP BY logic.INSERT/UPDATE operations in custom migration logic.DB::select() with Select::from()->where()->get().class AtlasQueryBuilder {
public static function select(): Select {
return new Select();
}
}
$users = AtlasQueryBuilder::select()
->from('users')
->whereEquals(['active' => true])
->get();
INSERT before SELECT).LIMIT/OFFSET vs. FETCH FIRST).NULL handling, collations).whereRaw), subqueries in having, or dynamic column selection.where() with raw SQL or extend Atlas classes.:param), while Laravel uses ? placeholders. Ensure consistency in execution.composer.json as a dev dependency.whereEquals()) enforces type safety.where() clauses to methods).where() calls).tinker or debugbar may not integrate seamlessly with Atlas.How can I help you explore Laravel packages today?