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

AbandonedArchivedLibrary

pixelfederation/vitess-php-pdo
==============================

PHP PDO compliant driver for Vitess PHP client.

0.3.2(8y ago)3233.1k6BSD-3-ClausePHPPHP &gt;=5.6

Since Feb 23Pushed 8y ago9 watchersCompare

[ Source](https://github.com/pixelfederation/vitess-php-pdo)[ Packagist](https://packagist.org/packages/pixelfederation/vitess-php-pdo)[ Docs](https://git.pixelfederation.com/shared/Vitess.Driver.PHP)[ RSS](/packages/pixelfederation-vitess-php-pdo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (28)Used By (0)

Vitess PDO driver
=================

[](#vitess-pdo-driver)

This library provides a PDO driver for [Vitess](http://vitess.io/). It is not a driver for the PDO PHP extension, it's just a pure PHP implementation of the PDO interface. It is interchangeable with the original PDO class, if no instanceof \\PDO checks are present in the application code.

Current state
-------------

[](#current-state)

Currently the code is beta quality, not all PDO methods and classes are implemented, but it already has been tested in our application and it works properly. Everybody is welcome to create pull requests to implement some of the missing things.

Also, the unit tests are currently bound to our Vitess dev instance, there is a plan to change this. There's also not much documentation yet, but people requested the driver, so we decided to go open source.

This driver isn't compatible with any official MySql/MariaDB management tools, but we created an [Adminer fork](https://github.com/pixelfederation/adminer), which you can use to have some insight about the data in your Vitess cluster.

Usage
-----

[](#usage)

The [Vitess PHP client](https://github.com/youtube/vitess/tree/master/php), which is used in the PDO implementation has a dependency on the [PHP GRPC extension](https://github.com/grpc/grpc/tree/master/src/php), which has to be installed together with [GRPC](http://www.grpc.io/) and [Protobuf](https://developers.google.com/protocol-buffers/?hl=en).

To install the composer package, run the following command:

```
composer require pixelfederation/vitess-php-pdo
```

After the installation of the dependencies, the PDO class should be instantiated this way:

```
$pdo = new \VitessPdo\PDO("keyspace={$keyspace};host={$host};port={$port}");
```

- $keyspace: vitess keyspace (alternative to database name)
- $host: IP or hostname of Vtgate
- $port: Vtgate port

If you want to use some limited DDL support, you have to instantiate the PDO instance this way:

```
$pdo = new \VitessPdo\PDO("vitess:cell={$cell};keyspace={$keyspace};host={$host};port={$port};vtctld_host={vtcrld_host};vtctld_port={vtctld_port}");
```

- $cell: name of the Vitess cell
- $vtctld\_host: IP or hostname of Vtctld
- $vtctld\_port: Vtctld port

Only a limited subset of DDL queries is supported (the goal of the implementation was to get the PDO driver work with [Adminer](https://github.com/pixelfederation/adminer).

Contribution
------------

[](#contribution)

If you'd like to contribtue, we strongly recommend to run

```
./bin/setup-dev
```

from the project directory. This script will set up a commit hook, which checks the PSR/2 coding standards using [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer) and also runs PHP linter and PHP Mess Detector [PHPMD](http://phpmd.org/)

To be able to run the unit tests, you need to have installed Vitess locally for now (there is a guide for [Ubuntu and OS X](http://vitess.io/getting-started/local-instance.html)).

The tests need to be run from a shell which has set all the environment variables from the guide, to be ready to run vitess instances. After setting the enviroment variables, just got to the library root folder and run the following command:

```
./bin/phpunit
```

If there is a need to perform any sql queries in the newly written unit tests, there is a database schema provided in the **tests/vitess/schema** folder. The schema contains two shards - **lookup** and **user**.

Known issues
------------

[](#known-issues)

On OS X there is was "sometimes" a problem with the current GRPC version (0.13) and PHP GRPC extension (0.8) (both of the versions are mandatory for the PDO driver and Vitess), meaning that the GRPC requests to Vitess are a little bit slower [for an unknown reason](https://github.com/grpc/grpc/issues/4806). Linux is unaffected.

Also, there is no PHP 7 GRPC extension yet.

Both issues were resolved in grpc [1.0.0RC1 and 1.0.0RC2](https://pecl.php.net/package/gRPC), the extension should be stable now.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~24 days

Recently: every ~62 days

Total

27

Last Release

3105d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f41a9b6b3fcc495a546791e3993b29832b7a4b08f34ad094a1131e2e8784d01?d=identicon)[pixelfederation](/maintainers/pixelfederation)

---

Top Contributors

[![Rastusik](https://avatars.githubusercontent.com/u/1735097?v=4)](https://github.com/Rastusik "Rastusik (5 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (1 commits)")

---

Tags

pdodriverVitess

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/pixelfederation-vitess-php-pdo/health.svg)](https://phpackages.com/packages/pixelfederation-vitess-php-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)[mongodb/mongodb

MongoDB driver library

1.6k64.0M543](/packages/mongodb-mongodb)[smi2/phpclickhouse

PHP ClickHouse Client

83510.1M71](/packages/smi2-phpclickhouse)[cakephp/database

Flexible and powerful Database abstraction library with a familiar PDO-like API

9724.6M33](/packages/cakephp-database)[falseclock/dbd-php

Database driver for PHP (PostgreSQL, MySQL, MSSQL, OData, YellowERP, 1С)

116.8k](/packages/falseclock-dbd-php)[coincheck/coincheck

Bindings of coincheck API

202.2k](/packages/coincheck-coincheck)

PHPackages © 2026

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