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

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

particlebits/pdo
================

Smallest possible PDO database while being super useful

2.1.4(4y ago)76.8k↓46.9%1MITPHPPHP &gt;= 5.6

Since Sep 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ParticleBits/pdo)[ Packagist](https://packagist.org/packages/particlebits/pdo)[ Docs](https://github.com/particlebits/pdo)[ RSS](/packages/particlebits-pdo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (10)Used By (1)

\\Pb\\PDO
=========

[](#pbpdo)

Micro PDO Library
-----------------

[](#micro-pdo-library)

[![Latest Stable Version](https://camo.githubusercontent.com/93b22812b71f33bdf4a0425f1e08ddd2c82ec318aa38ccba9fe15ed2a427b92d/68747470733a2f2f706f7365722e707567782e6f72672f5061727469636c65426974732f70646f2f762f737461626c65)](https://packagist.org/packages/ParticleBits/pdo)[![License](https://camo.githubusercontent.com/0b8748850c78feba0f0e6dd25b8db310b97160b9e879d5ef2c956a9de5312706/68747470733a2f2f706f7365722e707567782e6f72672f5061727469636c65426974732f70646f2f6c6963656e7365)](https://packagist.org/packages/ParticleBits/pdo)

Smallest possible PDO database while still being super useful

### Installation

[](#installation)

Use [Composer](https://getcomposer.org/)

```
"require": {
    "ParticleBits/pdo": "~2.0"
}
```

### Features

[](#features)

- Compatible with PHP 5.6 and higher!
- Tested on all versions of PHP 5.6 -&gt; 7.4 *(Not tested yet on PHP 8.x)*
- No dependencies other than the PDO extension
- Tiny footprint

### Usage

[](#usage)

Examples selecting, inserting, updating and deleting data from or into the `users` table.

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

$dsn = 'mysql:host=your_db_host;dbname=your_db_name;charset=utf8';
$usr = 'your_db_username';
$pwd = 'your_db_password';

$pdo = new \Pb\PDO\Database($dsn, $usr, $pwd);

// SELECT * FROM users WHERE id = ?
$stmt = $pdo
    ->select()
    ->from('users')
    ->where('id', '=', 1234)
    ->execute();

$data = $stmt->fetch();

// INSERT INTO users (id , usr , pwd) VALUES (? , ? , ?)
$stmt = $pdo
    ->insert(['id', 'usr', 'pwd'])
    ->into('users')
    ->values([1234, 'your_username', 'your_password']);

$insertId = $stmt->execute(true); // true returns insert ID

// UPDATE users SET pwd = ? WHERE id = ?
$stmt = $pdo
    ->update(['pwd' => 'your_new_password'])
    ->table('users')
    ->where('id', '=', 1234);

$affectedRows = $stmt->execute();

// DELETE FROM users WHERE id = ?
$stmt = $pdo
    ->delete()
    ->from('users')
    ->where('id', '=', 1234);

$affectedRows = $stmt->execute();
```

### Notes on the `sqlsrv` extension

[](#notes-on-the-sqlsrv-extension)

The `sqlsrv` extension will fail to connect when using error mode `PDO::ERRMODE_EXCEPTION` (default). To connect, you will need to explicitly pass `array(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING)` (or `PDO::ERRMODE_SILENT`) into the constructor, or override the `getDefaultOptions()` method when using `sqlsrv`.

### Documentation

[](#documentation)

See [DOCUMENTATION](https://github.com/ParticleBits/PDO/blob/master/docs/README.md)

### Changelog

[](#changelog)

See [CHANGELOG](https://github.com/ParticleBits/PDO/blob/master/CHANGELOG.md)

### License

[](#license)

See [LICENSE](https://github.com/ParticleBits/PDO/blob/master/LICENSE)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~2 days

Total

9

Last Release

1502d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4adc538cac0f186f01fa1d0e44150682928940423cecd291cc0f15ad671faf4a?d=identicon)[mikegioia](/maintainers/mikegioia)

---

Top Contributors

[![FaaPz](https://avatars.githubusercontent.com/u/1536742?v=4)](https://github.com/FaaPz "FaaPz (38 commits)")[![mikegioia](https://avatars.githubusercontent.com/u/387937?v=4)](https://github.com/mikegioia "mikegioia (28 commits)")[![scheras](https://avatars.githubusercontent.com/u/7363137?v=4)](https://github.com/scheras "scheras (3 commits)")[![delef](https://avatars.githubusercontent.com/u/2103263?v=4)](https://github.com/delef "delef (2 commits)")[![terah](https://avatars.githubusercontent.com/u/2120322?v=4)](https://github.com/terah "terah (1 commits)")[![bmutinda](https://avatars.githubusercontent.com/u/1729141?v=4)](https://github.com/bmutinda "bmutinda (1 commits)")[![WFrancois](https://avatars.githubusercontent.com/u/5872952?v=4)](https://github.com/WFrancois "WFrancois (1 commits)")[![ismnoiet](https://avatars.githubusercontent.com/u/5025240?v=4)](https://github.com/ismnoiet "ismnoiet (1 commits)")[![kwhat](https://avatars.githubusercontent.com/u/676164?v=4)](https://github.com/kwhat "kwhat (1 commits)")[![procket-org](https://avatars.githubusercontent.com/u/5643421?v=4)](https://github.com/procket-org "procket-org (1 commits)")

---

Tags

micromysqlpdopdo-wrapperphptinydatabasepdomicro pdotiny pdo

### Embed Badge

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

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

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[ifsnop/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k5.5M69](/packages/ifsnop-mysqldump-php)[nette/database

💾 Nette Database: layer with a familiar PDO-like API but much more powerful. Building queries, advanced joins, drivers for MySQL, PostgreSQL, SQLite, MS SQL Server and Oracle.

5656.7M234](/packages/nette-database)[dibi/dibi

Dibi is Database Abstraction Library for PHP

5013.8M120](/packages/dibi-dibi)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[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)

PHPackages © 2026

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