PHPackages                             packaged/querybuilder - 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. packaged/querybuilder

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

packaged/querybuilder
=====================

Abstract Query Builder

0.24.0(1y ago)790.3k↓41.3%[1 issues](https://github.com/packaged/querybuilder/issues)1MITPHPPHP &gt;=7.4

Since Oct 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/packaged/querybuilder)[ Packagist](https://packagist.org/packages/packaged/querybuilder)[ RSS](/packages/packaged-querybuilder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (66)Used By (1)

Query Builder
=============

[](#query-builder)

[![Latest Stable Version](https://camo.githubusercontent.com/e09a364b1fc47a1e5be74c003bceabf458604293379dc03a2e30c420cf20858f/68747470733a2f2f706f7365722e707567782e6f72672f7061636b616765642f71756572796275696c6465722f76657273696f6e2e706e67)](https://packagist.org/packages/packaged/querybuilder)[![Total Downloads](https://camo.githubusercontent.com/31f20d08c8995880074910497d71a2d97d943a106e2224fc6a95d615c6a8e746/68747470733a2f2f706f7365722e707567782e6f72672f7061636b616765642f71756572796275696c6465722f642f746f74616c2e706e67)](https://packagist.org/packages/packaged/querybuilder)[![CircleCI](https://camo.githubusercontent.com/6b04c792444e8df5c1ff1d5800c810a7958016b90161fcfd46b930bcd2392905/68747470733a2f2f636972636c6563692e636f6d2f67682f7061636b616765642f71756572796275696c6465722e7376673f7374796c653d736869656c64)](https://circleci.com/gh/packaged/querybuilder)[![Dependency Status](https://camo.githubusercontent.com/22aceac37c07e822a35c1ffbc675135723bbf52f6a783732d5d4d2e137193ee6/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f7061636b616765643a71756572796275696c6465722f62616467652e706e67)](https://www.versioneye.com/php/packaged:querybuilder)[![Coverage Status](https://camo.githubusercontent.com/6386ce5a98fb77063dde6de238dc4526256f23ba5363540f4a7a2346e8b10ddc/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7061636b616765642f71756572796275696c6465722f62616467652e706e67)](https://coveralls.io/r/packaged/querybuilder)

Reason
======

[](#reason)

This library exists as a standalone query builder designed to split every single element of a query to allow packages using the library to convert the query into a more performant query, or supporting functionality not available in the original database layer.

Examples
--------

[](#examples)

CQL (Cassandra) does not support CONCAT, so this can be pulled from the original query, the fields gathered and then concatinated in PHP.

When running a sharded database, the query can be rebuilt to execute across multiple nodes with the correct partitioning keys, and then presented back to the user as a single result.

Terms
=====

[](#terms)

Base on information found on wikipedia -

Clauses
-------

[](#clauses)

Are constituent components of statements and queries.

Expressions
-----------

[](#expressions)

which can produce either scalar values, or tables consisting of columns and rows of data

Predicates
----------

[](#predicates)

Specify conditions that can be evaluated to SQL three-valued logic (3VL) (true/false/unknown) or Boolean truth values and are used to limit the effects of statements and queries, or to change program flow.

Statements
----------

[](#statements)

May have a persistent effect on schemata and data, or may control transactions, program flow, connections, sessions, or diagnostics.

Query Statement
---------------

[](#query-statement)

Retrieve data based on specific criteria.

Select Expression
-----------------

[](#select-expression)

Columns and Functions used to build the returning data

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~56 days

Recently: every ~399 days

Total

64

Last Release

714d ago

PHP version history (3 changes)0.1.0PHP &gt;=5.4.0

0.3.0PHP &gt;=5.6.0

0.24.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/a2dc779402c4fa879b9f63159900da2a4c766661286182c4cecd66a7d4fc71ed?d=identicon)[bajbnet](/maintainers/bajbnet)

![](https://avatars.githubusercontent.com/u/299656?v=4)[Tom Kay](/maintainers/tomk)[@TomK](https://github.com/TomK)

---

Top Contributors

[![bajb](https://avatars.githubusercontent.com/u/2241334?v=4)](https://github.com/bajb "bajb (68 commits)")[![TomK](https://avatars.githubusercontent.com/u/299656?v=4)](https://github.com/TomK "TomK (66 commits)")[![Jleagle](https://avatars.githubusercontent.com/u/381099?v=4)](https://github.com/Jleagle "Jleagle (3 commits)")[![rgooding](https://avatars.githubusercontent.com/u/3207236?v=4)](https://github.com/rgooding "rgooding (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/packaged-querybuilder/health.svg)

```
[![Health](https://phpackages.com/badges/packaged-querybuilder/health.svg)](https://phpackages.com/packages/packaged-querybuilder)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
