PHPackages                             tasoft/php-pdo - 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. tasoft/php-pdo

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

tasoft/php-pdo
==============

v0.8.12(3y ago)03286MITPHPPHP &gt;=7.2CI failing

Since Jan 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/tasoftch/php-pdo)[ Packagist](https://packagist.org/packages/tasoft/php-pdo)[ RSS](/packages/tasoft-php-pdo/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (1)Versions (15)Used By (6)

Php PDO Extension
=================

[](#php-pdo-extension)

This library extends the builtin PDO object by several useful features.

It adds Php generators to fetch rows and insert or update records.

### Simple SELECT

[](#simple-select)

```
$gen = $PDO->select("SELECT * FROM XXX");
// Now $gen is a generator, that means nothing happens until you want to fetch the records.

// ... more code

// Now, fetch the SQL records:
foreach($gen as $record) {
    // ...
}
```

also allowed is:

```
$gen = $PDO->select("SELECT * FROM XXX WHERE id = ?", [$objectID]);
// For secure SQL request.
```

### Injecting Records

[](#injecting-records)

```
$gen = $PDO->inject("INSERT INTO XXX (name, email) VALUES (?, ?)");
// Now again nothing happend yet.

// To insert records, just use.

$gen->send(["Thomas", "email@example.org"]);
// As many times you want!
```

Please note that the SQL syntax is directly passed to the built-in Php PDO object. See those documentation for more information about the SQL scripting language.

### Mapping

[](#mapping)

The library also allows to map values from raw format of a data base into objects and backwards.

```
$PDO->setTypeMapper( new DateMapper() );
// Now the methods selectWithObjects and injectWithObjects will convert raw values into their object values.

$record = $PDO->selectOneWithObjects("SELECT * FROM XXX");
print_r($record);
/*
Might look like:
Array (
    'the_date' => TASoft\Util\ValueObject\Date ... ,
    'the_date_time' => TASoft\Util\ValueObject\DateTime ... ,
    'the_time' => TASoft\Util\ValueObject\Time ...
)

// SQL:
CREATE TABLE XXX (
    the_date DATE DEFAULT NULL,
    the_date_time DATETIME DEFAULT NULL,
    the_time TIME DEFAULT NULL
)
*/

// This also works backward:
$newDate = new TASoft\Util\ValueObject\Date("1999-05-23");
$PDO->injectWithObjcts("UPDATE XXX SET the_date = ? WHERE ...")->send([$newDate, ...]);

// Using MapperChain allows to combine more than one type mapper.
```

Another advantage is the ability to perform transactions.
Transactions combine several SQL statements and make sure that everyone of them is performed successfully.
Like: All or nothing

```
$PDO->transaction(function() {
    /** @var TASoft\Util\PDO $this */
    $this->inject(....);

    $this->exec( .... );
    ...
});
```

If anywhere inside the code an exception occures, the transaction will be cancelled (rollBack).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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

Recently: every ~146 days

Total

14

Last Release

1191d ago

PHP version history (2 changes)v0.7.1PHP ^7.2

v0.7.2PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/c7b1a2883faeab6f2b9558df70ce847c9e7dc3467a64db4f694e0716e842e9f2?d=identicon)[tasoft](/maintainers/tasoft)

---

Top Contributors

[![tasoftch](https://avatars.githubusercontent.com/u/24875322?v=4)](https://github.com/tasoftch "tasoftch (40 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tasoft-php-pdo/health.svg)

```
[![Health](https://phpackages.com/badges/tasoft-php-pdo/health.svg)](https://phpackages.com/packages/tasoft-php-pdo)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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