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

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

tccl/database
=============

A simple PDO wrapper to eliminate DB connection boilerplate

v1.11.0(2y ago)015MITPHPPHP &gt;=7.4.0

Since Apr 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/TCCL/database)[ Packagist](https://packagist.org/packages/tccl/database)[ RSS](/packages/tccl-database/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (25)Used By (0)

```
database - v1.11.0
--------------------------------------------------------------------------------
This library provides a really simple PDO database connection wrapper in
addition to providing several database abstraction mechanisms for representing
database entities and schemas. This package is designed to eliminate boilerplate
associated with connecting to the database and managing credentials. Note that
this library does not provide fine-tuned query abstractions.

While targeting PDO lets the library use any database engine, the abstractions
code has been tested and developed for use with MySQL. That isn't to say it
won't necessarily work with another database engine though. You might have more
of a problem with compatibility with the Entity framework classes.

Primary authors:

    Roger Gee

--------------------------------------------------------------------------------
Installing

This library is available as a composer package. Require 'tccl/database' in your
composer.json file and then install.

--------------------------------------------------------------------------------
Classes

    TCCL\Database\DatabaseConnection
        Wraps PDO to represent a database connection

    TCCL\Database\Entity
        Provides an abstraction for managing a single entity

    TCCL\Database\EntityInsertSet
        Provides an abstraction for inserting multiple Entity objects

    TCCL\Database\EntityList
        Provides an abstraction for manipulating lists of database entities

    TCCL\Database\Schema
        Provides abstraction for defining and installing schemas

    TCCL\Database\ReflectionEntity
        Provides an Entity abstraction where metadata is obtained from doc comments

    TCCL\Database\ReflectionEntityTrait
        Used with ReflectionEntity

--------------------------------------------------------------------------------
Usage

[DatabaseConnection]

Use a DatabaseConnection instance to manage a database connection. The
connection parameters are to be stored in the $GLOBALS superglobal. The bucket
under this array is arbitrary and may be arbitrarily nested. The structure of
the bucket is an indexed array with three parts like:
