PHPackages                             thatzokay/wpdb-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. thatzokay/wpdb-builder

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

thatzokay/wpdb-builder
======================

Build database queries

1.0.1(11mo ago)05PHP

Since Jun 4Pushed 11mo agoCompare

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

READMEChangelog (2)DependenciesVersions (3)Used By (0)

wpdb Builder
============

[](#wpdb-builder)

An easier way to create custom queries using WordPress' wpdb functions. The class is based on the excellent [Pixie Query Builder](https://github.com/usmanhalalit/pixie).

Intended for plugin and theme developers craving sexier queries.

\*\* Be aware. This class in early development stages. \*\*

Install
-------

[](#install)

First clone the repository.

```
git clone https://github.com/tormjens/wpdb-builder.git wpdb-builder

```

Run a composer install inside the repository to generate the autoload files

```
composer install

```

Start using the class. Its namespaced under WpdbBuilder

```
use \WpdbBuilder\Builder;

var_dump(( Builder::table( 'posts' )->all() );
```

Example
-------

[](#example)

A standard wpdb query looks something like:

```
$sql = $wpdb->prepare( "SELECT * FROM {$wpdb->posts} WHERE id = %s LIMIT 1", 1 );
$result = $wpdb->get_row( $sql );
```

With the wpdb Builder the same query with the same results looks like:

```
$result = Builder::table('posts')->where('id', 1)->first();
```

For more detailed documentation, please have a look at the [Pixie Query Builder](https://github.com/usmanhalalit/pixie) repository as most of the methods are availiable in this very class.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance51

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

Total

2

Last Release

348d ago

### Community

Maintainers

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

---

Top Contributors

[![ThatzOkay](https://avatars.githubusercontent.com/u/6585530?v=4)](https://github.com/ThatzOkay "ThatzOkay (5 commits)")

### Embed Badge

![Health badge](/badges/thatzokay-wpdb-builder/health.svg)

```
[![Health](https://phpackages.com/badges/thatzokay-wpdb-builder/health.svg)](https://phpackages.com/packages/thatzokay-wpdb-builder)
```

###  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)
