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

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

tkaratug/titan-db
=================

Simple and useful query builder for PHP.

v1.0.1(9y ago)6183MITPHPPHP &gt;=5.4.0

Since Mar 23Pushed 9y ago2 watchersCompare

[ Source](https://github.com/tkaratug/TitanDB)[ Packagist](https://packagist.org/packages/tkaratug/titan-db)[ Docs](https://github.com/tkaratug/TitanDB)[ RSS](/packages/tkaratug-titan-db/feed)WikiDiscussions master Synced 1mo ago

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

TitanDB
-------

[](#titandb)

Simple query builder and PDO Class for PHP

[![Total Downloads](https://camo.githubusercontent.com/958331617f4b7987dee1d9dd79e331defe462c08be4ca35fc147b775be85d301/68747470733a2f2f706f7365722e707567782e6f72672f746b6172617475672f746974616e2d64622f642f746f74616c2e737667)](https://packagist.org/packages/tkaratug/titan-db)[![License](https://camo.githubusercontent.com/244a8fa3f3a0ea2b43d7c1cf502c15b9222e61ef18a9d2e5a723af7c21877a32/68747470733a2f2f706f7365722e707567782e6f72672f746b6172617475672f746974616e2d64622f6c6963656e73652e737667)](https://packagist.org/packages/tkaratug/titan-db)

Install
-------

[](#install)

Run the following command directly.

```
$ composer require tkaratug/titan-db

```

Example
-------

[](#example)

```
require 'vendor/autoload.php';

$config = [
	'db_driver'		=> 'mysql',
	'db_host'		=> 'localhost',
	'db_user'		=> 'root',
	'db_pass'		=> '',
	'db_name'		=> 'test',
	'db_charset'	=> 'utf8',
	'db_collation'	=> 'utf8_general_ci',
	'db_prefix'	 	=> ''
];

$db = TitanDB::init($config);

$records 	= $db->select('user_id, first_name, last_name, email')
				 ->from('users')
				 ->where('active', 1)
				 ->order_by('user_id', 'asc')
				 ->get()
				 ->results();
var_dump($records);

// Get all columns
$records	= $db->get('users')->results();
var_dump($records);

// Get all columns in a row
$db->where('user_id', 5);
$records	= $db->get('users')->row();
var_dump($records);

// JOIN Usage
$record 	= $db->select('t1.user_id, t1.first_name, t1.last_name, t2.group_name')
				 ->from('users as t1')
				 ->join('groups as t2', 't1.user_id=t2.user_id', 'left')
				 ->where('t1.active', 1)
				 ->get()
				 ->results();
var_dump($record);

// INSERT Usage
$data = [
	'first_name' 	=> 'John',
	'last_name'		=> 'Doe',
	'email'			=> 'john@doe.com'
];

$db->insert('users', $data);

// UPDATE Usage
$data = [
	'first_name' 	=> 'John',
	'last_name'		=> 'Doe',
	'email'			=> 'john@doe.com'
];

$db->where('user_id', 5);
$db->update('users', $data);

// DELETE Usage
$db->where('user_id', 5);
$db->delete('users');
```

Licence
-------

[](#licence)

[MIT Licence](http://opensource.org/licenses/MIT)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% 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

Unknown

Total

1

Last Release

3335d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/50dc98a0c75a1aaba61d52bb073e1b0cbdb17f4d5ed4bd1c694c71784b088e16?d=identicon)[tkaratug](/maintainers/tkaratug)

---

Top Contributors

[![tkaratug](https://avatars.githubusercontent.com/u/4394344?v=4)](https://github.com/tkaratug "tkaratug (19 commits)")[![hasan](https://avatars.githubusercontent.com/u/1433911?v=4)](https://github.com/hasan "hasan (1 commits)")

---

Tags

phpmysqlsqlpdoquerybuilder

### Embed Badge

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

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

###  Alternatives

[ifsnop/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k5.5M69](/packages/ifsnop-mysqldump-php)[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)[izniburak/pdox

Useful Query Builder, PDO Class for PHP. A simple access to your SQL records.

30221.1k7](/packages/izniburak-pdox)[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.9k](/packages/clouddueling-mysqldump-php)[bentools/where

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

125.2k2](/packages/bentools-where)

PHPackages © 2026

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