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

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

primal/query
============

Chain-able asynchronous query builder for MySQL PDO

v1.0.1(13y ago)415MITPHPPHP &gt;=5.3.3

Since Nov 29Pushed 13y ago1 watchersCompare

[ Source](https://github.com/PrimalPHP/Query)[ Packagist](https://packagist.org/packages/primal/query)[ Docs](http://github.com/PrimalPHP/Query)[ RSS](/packages/primal-query/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

\#Primal.Query

Created and Copyright 2012-2013 by Jarvis Badgley, chiper at chipersoft dot com.

Primal.Query is a chain-able asynchronous query builder class which allows for easy construction and execution of complex queries with data escapement.

[Primal PHP](http://www.primalphp.com) is a collection of independent PHP micro-libraries.

\##Requirements

Primal.Query requires PHP 5.3 (tested under 5.3.10). Use of the built in execution methods (select(), insert(), delete(), etc) requires the PHP Data Objects (PDO) extension be installed and configured.

\##Usage

A Query object can be initialized directly via the `new` operator, but the intended implementation is for initial properties to be chained off of a static initialization method. Example:

```
$q=Primal\Query\MySQL::Make($pdo) //$pdo contains your PDO link object
   ->from('users','u')
   ->leftJoin("user_billing b USING (user_id)")
   ->orderBy('u.name')
   ->returns('u.id', 'u.name', 'b.start_date')
   ->whereTrue('b.active')
   ->whereDateInRange('b.start_date', new DateTime('yesterday'));
$results = $q->select();
```

If you wish to run the query yourself instead of using the built in execution functions, the `build*` functions will return a tuple array containing the query text and an array of all named parameters.

\##Documentation

Method documentation is still forthcoming. In the meantime please use the doc comments in the class itself.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

4915d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/31834882?v=4)[ChiperSoft](/maintainers/ChiperSoft)[@ChiperSoft](https://github.com/ChiperSoft)

---

Top Contributors

[![Twipped](https://avatars.githubusercontent.com/u/231157?v=4)](https://github.com/Twipped "Twipped (2 commits)")

---

Tags

databasemysqlpdoquery

### Embed Badge

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

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

###  Alternatives

[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[envms/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

925511.7k13](/packages/envms-fluentpdo)[lichtner/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

921274.8k6](/packages/lichtner-fluentpdo)[fpdo/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

921244.9k7](/packages/fpdo-fluentpdo)[atlas/query

Object-oriented query builders and performers for MySQL, Postgres, SQLite, and SQLServer.

41249.0k7](/packages/atlas-query)[codesvault/howdy-qb

Mysql Query Builder for WordPress

371.2k1](/packages/codesvault-howdy-qb)

PHPackages © 2026

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