PHP Query Builder
PHP Query Builder: A PHP library for portable SQL construction, with room for CTEs and raw expressions. Ranked #27 of 51 in Database Query Builders by our editors (6.3/10); pricing: Free plan; best for PHP teams wanting CTEs and framework bridges.
At a glance
- Editor score6.3 / 10
- PricingFree plan
- Best forPHP teams wanting CTEs and framework bridges
- Free planYes
- Paid fromNone
- Type safetyOptional
- Facts checked4 Oct 2026
Where it wins
- Builds SELECT, INSERT, UPDATE and DELETE queries with a fluent API
- Supports five SQL dialects, including PostgreSQL and SQL Server
- Bridges PDO and Doctrine DBAL, with Symfony bundle integration
Where it doesn't
- Requires PHP development and self-hosted integration
- Async queries are not supported
- Raw SQL expressions may reduce query portability
Our verdict on PHP Query Builder
PHP Query Builder is an open-source library from MakinaCorpus for constructing SQL through a fluent PHP API. It suits PHP developers who want to build queries in application code rather than work through a hosted database interface. It covers common SELECT, INSERT, UPDATE and DELETE operations, and supports MariaDB, MySQL, PostgreSQL, SQLite and SQL Server. The published feature set also includes optional type safety and query compilation, alongside an escape hatch for raw SQL.
Its breadth is useful when a project needs more than CRUD construction. Common table expressions, aggregate functions and window functions support more involved query patterns, while raw SQL expressions allow database-specific syntax inside otherwise built queries. That flexibility comes with a portability tradeoff: a query containing dialect-specific raw SQL may not transfer cleanly between supported databases. Teams that value a shared query-building layer can use the library's dialect support; teams whose work depends on asynchronous queries should look elsewhere, since async queries are not supported.
The integration options fit existing PHP stacks: bridges are available for PDO and Doctrine DBAL, and a Symfony bundle is offered. It is self-hosted software, so adoption involves integrating the library into a PHP application rather than signing up for a hosted service. The open-source model and free plan make it a fit across solo through enterprise teams, but the central decision is technical fit, not a managed service feature set. PHP teams seeking CTEs and framework bridges should consider it; teams outside PHP or seeking async query execution should choose another approach.
Your product? Our editors can test PHP Query Builder in depth and publish a review, labelled as paid · from $99/mo →
PHP Query Builder pricing
PHP Query Builder fact sheet
| Free plan | Yes |
|---|---|
| Paid from | None |
| Languages | PHP |
| SQL dialects | MariaDB, MySQL, PostgreSQL, SQLite, SQL Server |
| Type safety | Optional |
| Async queries | No |
| Raw SQL support | Yes |
| Compile without execution | Yes |
| Deployment | Self-hosted |
| Built for | Solo, Small business, Mid-market, Enterprise (editorial estimate) |
| Integrations | 3 integrations: PDO, Doctrine DBAL, Symfony |
| Pricing | Free plan |
| Website | php-query-builder.readthedocs.io |
| Facts checked | 4 Oct 2026 |
PHP Query Builder integrations
PHP Query Builder lists 3 integrations on its own site.
- PDO
- Doctrine DBAL
- Symfony
Alternatives to PHP Query Builder
- jOOQA fluent SQL framework for JVM teams that want generated, type-safe database access.9.3
- SQLAlchemySQL construction, ORM, and database services for Python applications.9.1
- JetBrains ExposedA free, open-source Kotlin library with a type-safe SQL DSL and JDBC and R2DBC access.9.0
See all PHP Query Builder alternatives →
Used PHP Query Builder? Be the first to review it
The editor score above is our own research. What this page doesn't have yet is a reader's view — what you used PHP Query Builder for, what worked and what didn't. No stars are seeded and no review is paid for; an editor reads every one before it appears.
Write a reviewTwo minutes · verified accounts only · read by an editor before it appears
Featured on iTechGuides
PHP Query Builder is listed in our Database Query Builders directory. Add the badge to your site — it links back to this page.
<a href="https://www.itechguides.com/products/php-query-builder/"><img src="https://www.itechguides.com/best/badge/php-query-builder.svg" alt="Featured on iTechGuides" width="230" height="46"></a>
Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026
Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. How we rank.
Last updated · How we research and update
