PHPackages                             titon/db - 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. titon/db

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

titon/db
========

The Titon database package provides a basic database abstraction layer and an object relational mapper.

0.15.3(11y ago)126601BSD-2PHPPHP &gt;=5.4.0

Since Jun 16Pushed 11y ago3 watchersCompare

[ Source](https://github.com/titon/db)[ Packagist](https://packagist.org/packages/titon/db)[ Docs](http://titon.io)[ RSS](/packages/titon-db/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (7)Versions (60)Used By (1)

Database v0.15.3 [![Build Status](https://camo.githubusercontent.com/b19019671d5aa3b991152d6822cd08d3af7c5738b9f7ecc6ee66033e76518ab2/68747470733a2f2f7472617669732d63692e6f72672f7469746f6e2f64622e706e67)](https://travis-ci.org/titon/db)
============================================================================================================================================================================================================================================

[](#database-v0153-)

The Titon Database package provides a lightweight and low-level interface for interacting with database engines (known as drivers). The DB package comes bundled with a robust database abstraction layer (DBAL), an object oriented query builder, a powerful SQL dialect formatter, a data type caster, custom finder classes, behaviors, mappers, schemas, and many more.

```
$db = Titon\Db\Database::registry();
$db->addDriver('default', new Titon\Db\Mysql\MysqlDriver([
    'user' => 'root',
    'pass' => 'pass'
]));

$users = new Titon\Db\Repository(['table' => 'users']);
$entities = $users->select()->where('status', 1)->orderBy('created_at', 'desc')->all();
```

Supported database engines are packaged as individual driver packages, which are listed below.

### Drivers

[](#drivers)

- `MySQL` -
- `PostgreSQL` -
- `SQLite` -
- `MongoDB` -

### Features

[](#features)

- `Database` - Driver manager
- `Repository` - Table representation, queries drivers, maps relations and returns entities
- `Behavior` - Executes logic during database events
- `Entity` - Single record of data
- `EntityCollection` - Collection of entities
- `Finder` - Select query formatting
- `Driver` - Interacts with a database or remote service
    - `Dialect` - Driver specific SQL formatting
    - `Schema` - Repository schema
    - `Type` - Data type mapping
    - `ResultSet` - Result set mapper
- `Query` - Object oriented query builder
    - `RawExpr` - Raw expression builder
    - `Expr` - Expression builder
    - `Func` - Function builder
    - `Join` - Join builder
    - `Predicate` - Clause builder

### Dependencies

[](#dependencies)

- `Common`
- `Event`
- `Type`
- `Cache` (optional)
- `Psr\Log` (optional)

### Requirements

[](#requirements)

- PHP 5.4.0
    - PDO

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

59

Last Release

4348d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7fde949ba5bf8f6af95b77cf88fe1362c4cc7519edbcd4f8891f1564da621fdb?d=identicon)[milesj](/maintainers/milesj)

---

Top Contributors

[![milesj](https://avatars.githubusercontent.com/u/143744?v=4)](https://github.com/milesj "milesj (443 commits)")

---

Tags

typeschemadatabasequerydbentityConnectiondrivertitonrelationdialectpredicateclause

### Embed Badge

![Health badge](/badges/titon-db/health.svg)

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

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