PHPackages                             vectorface/mysqlite - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. vectorface/mysqlite

ActiveLibrary[Testing &amp; Quality](/categories/testing)

vectorface/mysqlite
===================

Select MySQL compatibility functions for PDO's SQLite driver

v0.2.2(4mo ago)3639.5k↓41.3%71MITPHPPHP ^8.0.0CI passing

Since Oct 14Pushed 4mo ago12 watchersCompare

[ Source](https://github.com/Vectorface/MySQLite)[ Packagist](https://packagist.org/packages/vectorface/mysqlite)[ Docs](https://github.com/Vectorface/MySQLite)[ RSS](/packages/vectorface-mysqlite/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (14)Used By (1)

MySQLite
========

[](#mysqlite)

[![Build Status](https://github.com/Vectorface/MySQLite/actions/workflows/ci.yml/badge.svg)](https://github.com/Vectorface/MySQLite/actions)[![Code Coverage](https://camo.githubusercontent.com/84856028f9f943b52a9a33fdb58e6e1d2b3c14c181da5f756b245a0f8b56f2d2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f566563746f72666163652f4d7953514c6974652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Vectorface/MySQLite/?branch=master)

MySQLite is an easy way to add MySQL functions to SQLite accessed through PDO. This can be useful for testing and development where an SQLite database may be more practical than a real MySQL database.

Usage
-----

[](#usage)

Using MySQLite is meant to be a one-step affair, with no configuration required:

```
use Vectorface\MySQLite\MySQLite;

// Create a PDO instance on an SQLite database
$pdo = new PDO('sqlite::memory:');

// Create compatibility functions for use within that database connection.
MySQLite::createFunctions($pdo);

// Use it.
$three = $pdo->query("SELECT BIT_OR(1, 2)")->fetch(PDO::FETCH_COLUMN);
// Wait... That works now?!? What the what?!?

```

It is also possible to use it as a one-liner:

```
$pdo = MySQLite::createFunctions(new PDO('sqlite::memory:'));
```

You can get a list of supported functions with `MySQLite::getFunctionList()`.

Limitations
-----------

[](#limitations)

MySQLite only provides a limited subset of MySQL functions. There are a lot of MySQL functions, so there's both a developer cost and performance penalty to adding them all.

If you want to add more, it's easy. You only need to add a function called mysql\_\[function name\] into one of the traits in src/Vectorface/MySQLite/MySQL.

For example, to create a function `FOO()` with silly behavior in String.php:

```
	...
	public static function mysql_foo($foo)
	{
		if ($foo == "foo") {
			return "bar";
		}
		return $foo;
	}
	...
```

With the above definition present, String::mysql\_foo will automatically be registered with `MySQLite::createFunctions($pdo)` is used.

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance77

Regular maintenance activity

Popularity40

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 83% 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 ~410 days

Recently: every ~592 days

Total

11

Last Release

126d ago

PHP version history (2 changes)v0.1.0PHP &gt;=5.4.0

v0.2.0PHP ^8.0.0

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/7a6bd4b7a52a1ed056c6d597c4124a62da080137edd42cc34355ac2c28e4a154?d=identicon)[francislavoie](/maintainers/francislavoie)

---

Top Contributors

[![jdpanderson](https://avatars.githubusercontent.com/u/4468291?v=4)](https://github.com/jdpanderson "jdpanderson (44 commits)")[![hzweb](https://avatars.githubusercontent.com/u/5245363?v=4)](https://github.com/hzweb "hzweb (5 commits)")[![francislavoie](https://avatars.githubusercontent.com/u/2111701?v=4)](https://github.com/francislavoie "francislavoie (1 commits)")[![leshow](https://avatars.githubusercontent.com/u/1128302?v=4)](https://github.com/leshow "leshow (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![Sun-nyL](https://avatars.githubusercontent.com/u/206748732?v=4)](https://github.com/Sun-nyL "Sun-nyL (1 commits)")

---

Tags

compatibilitytestingdebugmysqlsqlite

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/vectorface-mysqlite/health.svg)

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

###  Alternatives

[chriskite/phactory

A Database Factory for PHP Unit Tests

140216.9k8](/packages/chriskite-phactory)[guanguans/laravel-soar

SQL optimizer and rewriter for laravel. - laravel 的 SQL 优化器和重写器。

2227.8k](/packages/guanguans-laravel-soar)[derptest/phpmachinist

Testing object factory for PHP

3636.9k1](/packages/derptest-phpmachinist)[phpmachinist/phpmachinist

Testing object factory for PHP

3630.7k](/packages/phpmachinist-phpmachinist)[socialblue/laravel-query-adviser

With Laravel Query Adviser you can get more insights into the SQL queries created by Eloquent models used in your app. It logs the queries used by your application and provides a helpful overview of the SQL queries. You can rerun the SQL query to analyze the database impact or copy the SQL query to your clipboard. The handy card view allows you to quickly point out the pain points of your application's SQL queries.

203.5k](/packages/socialblue-laravel-query-adviser)

PHPackages © 2026

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