PHPackages                             hemiframe/php-query-builder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. hemiframe/php-query-builder

ActiveLibrary[Database &amp; ORM](/categories/database)

hemiframe/php-query-builder
===========================

Powerful and lightweight PHP SQL Query Builder

2.1.2(1y ago)1018.2k↓15%2[1 PRs](https://github.com/heminei/php-query-builder/pulls)MITPHPPHP &gt;=8.0

Since May 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/heminei/php-query-builder)[ Packagist](https://packagist.org/packages/hemiframe/php-query-builder)[ RSS](/packages/hemiframe-php-query-builder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (20)Used By (0)

php-query-builder
=================

[](#php-query-builder)

Powerful and lightweight PHP SQL Query Builder with fluid interface SQL syntax using bindings and complicated query generation

Features
--------

[](#features)

- multiple databases (multiple PDO instances)
- INSERT, INSERT IGNORE, INSERT DELAYED, UPDATE, SELECT, DELETE queries
- support LEFT JOIN, INNER JOIN, RIGHT JOIN, GROUP BY, LIMIT, HAVING and etc.
- =, !=, &gt;, &lt;, &gt;=, &lt;=, IN, NOT IN, IS NULL, NOT NULL operators
- support transactions and sub-queries
- support result caching (`\Psr\SimpleCache\CacheInterface`)
- multiple fetching data modes (fetch arrays, fetch objects, etc.)
- auto escape column names
- auto format queries
- auto bind variables
- hydration to objects (auto cast types from annotations and property types). See `demo/hydration.php`

Quick install
-------------

[](#quick-install)

---

The recommended way to install the Query Builder is through Composer. Run the following command to install it:

```
composer require hemiframe/php-query-builder
```

Set default PDO instance:

```
