[DEPRECATED] Database package for Titon.
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
src/Titon/Db
tests
.gitignore
.travis.yml
composer.json
license.md
phpunit.xml
readme.md
version.md

readme.md

Database v0.15.3 Build Status

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

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

  • Common
  • Event
  • Type
  • Cache (optional)
  • Psr\Log (optional)

Requirements

  • PHP 5.4.0
    • PDO