PHPackages                             semperton/query - 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. semperton/query

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

semperton/query
===============

A small and standalone SQL query builder.

1.0.0(3y ago)073MITPHPPHP &gt;=7.2

Since May 14Pushed 3y agoCompare

[ Source](https://github.com/semperton/query)[ Packagist](https://packagist.org/packages/semperton/query)[ RSS](/packages/semperton-query/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (7)Dependencies (3)Versions (8)Used By (0)

[![Semperton](https://raw.githubusercontent.com/semperton/.github/main/readme-logo.svg)](https://github.com/semperton)Semperton Query
===============

[](#semperton-query)

A small and standalone SQL query builder.

---

Installation
------------

[](#installation)

Just use Composer:

```
composer require semperton/query

```

Query requires PHP 7.2+

Intro
-----

[](#intro)

This is a SQL query builder only. All Instances of `ExpressionInterface` provide a `compile` method which takes a parameter array by reference and returns a parameter substituted SQL string that can be used with `PDO` for example.

```
$queryFactory = new QueryFactory();
$userSelect = $factory->select('user')->limit(5);

$sql = $userSelect->compile($params); // $params is passed by reference

$pdo = new PDO('dsn');
$stm = $pdo->prepare($sql);
$stm->execute($params);
$users = $stm->fetchAll();

// ...
```

Usage
-----

[](#usage)

Use your editor's autocomplete features for now ;)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~63 days

Recently: every ~83 days

Total

7

Last Release

1447d ago

Major Versions

0.3.0 → 1.0.02022-06-01

PHP version history (2 changes)0.2.0PHP &gt;=7.2.0

1.0.0PHP &gt;=7.2

### Community

Maintainers

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

---

Top Contributors

[![jrabausch](https://avatars.githubusercontent.com/u/38224080?v=4)](https://github.com/jrabausch "jrabausch (71 commits)")

---

Tags

phpqueryquery-buildersempertonsqlstandalone

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/semperton-query/health.svg)

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

###  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)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

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

Reliese Components for Laravel Framework code generation.

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

PHPackages © 2026

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