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

ActiveLibrary

twoleds/database-pdo
====================

Implementation of simple interface for accessing databases via pdo extension.

1.0(7y ago)09MITPHPPHP &gt;=7.0

Since Feb 3Pushed 7y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

The `twoleds/database-pdo` package
==================================

[](#the-twoledsdatabase-pdo-package)

This package provides implementation for simple interface for accessing database from the package `twoleds/database`.

Example
=======

[](#example)

```
$database = new PDODatabase("... pdo dsn", "user", "password", [
    // ... pdo attributes
]);

$userId = $database->insert(
    'INSERT INTO user (name, email) VALUES (?, ?)',
    'Spike',
    'spike@example.com'
);

$users = $database->select(
    'SELECT * FROM user WHERE email LIKE ?',
    '%@example.com'
);

$count = $database->selectField(
    'SELECT COUNT(*) FROM user WHERE email LIKE ?',
    '%@example.com'
);

$user = $database->selectRow(
    'SELECT * FROM user WHERE id = ?',
    123
);

$database->update(
    'UPDATE user SET name = ? WHERE id = ?',
    'Xavier',
    123
);

$database->update(
    'DELETE user WHERE id = ?',
    123
);

$database->transactional(function ($database) {
    $counter = $database->selectField(
        'SELECT counter FROM user WHERE id = ? FOR UPDATE',
        123
    );
    $counter = $counter + 1;
    $database->update(
        'UPDATE user SET counter = ? WHERE id = ?',
        123
    );
});
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

Unknown

Total

1

Last Release

2658d ago

### Community

Maintainers

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

---

Top Contributors

[![twoleds](https://avatars.githubusercontent.com/u/614302?v=4)](https://github.com/twoleds "twoleds (1 commits)")

### Embed Badge

![Health badge](/badges/twoleds-database-pdo/health.svg)

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

PHPackages © 2026

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