PHPackages                             selective/database - 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. selective/database

Abandoned → [cakephp/database](/?search=cakephp%2Fdatabase)ArchivedLibrary[Database &amp; ORM](/categories/database)

selective/database
==================

SQL query builder

3.2.0(3y ago)2396.1k4MITPHPPHP ^8.0

Since Aug 15Pushed 3y ago2 watchersCompare

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

READMEChangelog (10)Dependencies (4)Versions (24)Used By (0)

Database
========

[](#database)

A fluent SQL query builder.

[![Latest Version on Packagist](https://camo.githubusercontent.com/20712dd68af17ebbca1aea0372ca20a483ffc97f7e2d21b34e82b41fc6fcd6d1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f73656c6563746976652d7068702f64617461626173652e737667)](https://packagist.org/packages/selective/database)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Build Status](https://github.com/selective-php/database/workflows/build/badge.svg)](https://github.com/selective-php/database/actions)[![Coverage Status](https://camo.githubusercontent.com/bed7b577aab0b5513d3bdfa38d905e3cafd962b08b52416f9a8c488abc16e9eb/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f73656c6563746976652d7068702f64617461626173652e737667)](https://scrutinizer-ci.com/g/selective-php/database/code-structure)[![Quality Score](https://camo.githubusercontent.com/fe0d8e07d6ca150a25c42bd1e7d616acc4eb71f16088d754ed0d59cea4598287/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f73656c6563746976652d7068702f64617461626173652e737667)](https://scrutinizer-ci.com/g/selective-php/database/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/3b1ebd658c9fdae5e26d33397684dd52db207074ffc1ba0cb657d82cb7e31798/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73656c6563746976652f64617461626173652e737667)](https://packagist.org/packages/selective/database/stats)

Features
--------

[](#features)

- Fluent SQL query builder
- Table schema information and manipulation

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

[](#installation)

```
composer require selective/database

```

Requirements
------------

[](#requirements)

- PHP 8.0+
- MySQL 5.7+ or MariaDB

Documentation
-------------

[](#documentation)

The database query builder provides a convenient, fluent interface for creating and executing database queries. It can be used to perform most database operations in your PHP website and application.

For more details how to build queries please read the **[documentation](https://selective-php.github.io/database/)**.

Similar libraries
-----------------

[](#similar-libraries)

- [cycle/database](https://cycle-orm.dev/docs/query-builder-basic)
- [cakephp/database](https://github.com/cakephp/database)
- [laminas/laminas-db](https://docs.laminas.dev/laminas-db/)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 99.6% 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 ~87 days

Recently: every ~307 days

Total

23

Last Release

1269d ago

Major Versions

0.5.0 → 1.0.02018-02-10

1.x-dev → 2.0.02019-07-18

2.0.0 → 3.0.02020-05-11

PHP version history (4 changes)1.2.2PHP &gt;=7.1

3.0.0PHP &gt;=7.2

3.1.0PHP ^7.4 || ^8.0

3.2.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/89d408d7f6ed65cdbeba70a2da2d0a8a1135fc37ebc07c44989f509221cc91bd?d=identicon)[odan](/maintainers/odan)

---

Top Contributors

[![odan](https://avatars.githubusercontent.com/u/781074?v=4)](https://github.com/odan "odan (281 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

hacktoberfestmysqlpdophpquery-buildersqlsql-query-builderdatabasemysqlsqlquerybuilder

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/selective-database/health.svg)

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

###  Alternatives

[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)[nilportugues/sql-query-builder

An elegant lightweight and efficient SQL QueryInterface BuilderInterface supporting bindings and complicated query generation.

425239.4k6](/packages/nilportugues-sql-query-builder)[illuminated/db-profiler

Database Profiler for Laravel Web and Console Applications.

168237.4k](/packages/illuminated-db-profiler)[opis/database

A database abstraction layer over PDO, that provides a powerful and intuitive query builder, bundled with an easy to use schema builder

10184.2k3](/packages/opis-database)[bentools/where

PHP7.1 Fluent, immutable SQL query builder. Connectionless, framework-agnostic, no dependency.

125.2k2](/packages/bentools-where)[chillerlan/php-database

An extensible database wrapper and query builder.

431.2k2](/packages/chillerlan-php-database)

PHPackages © 2026

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