PHPackages                             plasma/core - 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. plasma/core

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

plasma/core
===========

Core component of Plasma.

v0.4.0(5y ago)13.3k23Apache-2.0PHPPHP &gt;=7.1

Since Dec 22Pushed 4y agoCompare

[ Source](https://github.com/PlasmaPHP/core)[ Packagist](https://packagist.org/packages/plasma/core)[ RSS](/packages/plasma-core/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (7)Versions (6)Used By (3)

Plasma Core [![CI status](https://github.com/PlasmaPHP/core/workflows/CI/badge.svg)](https://github.com/PlasmaPHP/core/actions)
===============================================================================================================================

[](#plasma-core-)

Plasma provides an asynchronous, non-blocking (data access) Database Abstraction Layer. This is the core component, defining common parts and interfaces.

The core component alone does **nothing**, you need a Plasma driver, which does all the handling of the DBMS.

Plasma does not aim to be a full Database Abstraction Layer. Simulating missing features is not a goal and should never be.

For a list of drivers, see the [main repository](https://github.com/PlasmaPHP/plasma).

Getting Started
===============

[](#getting-started)

As soon as you have selected a driver, you can install it using `composer`. For the core, the command is

```
composer require plasma/core

```

Each driver has their own dependencies, as such they have to implement a factory, which creates their driver instances correctly. For more information, see the driver project page.

But this is some little pseudo code:

```
use Plasma\Client;
use Plasma\QueryResultInterface;
use React\EventLoop\Factory;
use SomeGuy\PlasmaDriver\MsSQLFactory;

$loop = Factory::create();
$factory = new MsSQLFactory($loop);

$client = Client::create($factory, 'root:1234@localhost');

$client->execute('SELECT * FROM `users`', [])
    ->then(function (QueryResultInterface $result) use ($client) {
        // Do something with the query result
        // Most likely for a SELECT query,
        // it will be a streaming query result

        $client->close()->done();
    }, function (Throwable $error) use ($client) {
        // Oh no, an error occurred!
        echo $error.PHP_EOL;

        $client->close()->done();
    });

$loop->run();
```

Cursors
=======

[](#cursors)

Cursors are a powerful way to get full control over fetching rows. Cursors allow you to control when a row (or multiple) is fetched from the database and allows your application a small memory footprint while fetching millions of rows.

Cursors return a promise and resolve with the row, an array of rows or `false` (when no more rows). Since they return a promise, you don't need to depend on events and possibly buffer rows when passing around the result.

When combining cursors with generator coroutines (such as Recoil), you get a powerful tool you already know from PDO.

```
// Inside a coroutine
use Plasma\CursorInterface;

/** @var CursorInterface  $cursor */
$cursor = yield $client->createReadCursor('SELECT * FROM `my_table`');

while($row = yield $cursor->fetch()) {
    // Process row
}
```

Support for cursors depend on the individual drivers.

Documentation
=============

[](#documentation)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity50

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

Total

5

Last Release

1942d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/85dbed21ee3f899a9fac2a46423ba9b5fc227ab189da1a54787e82e1222aa472?d=identicon)[gitneko](/maintainers/gitneko)

---

Top Contributors

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

---

Tags

abstractionabstraction-layerasyncasynchronousdatabasephpphp-libraryphp7plasmaplasmaphpreactphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/plasma-core/health.svg)

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

###  Alternatives

[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

42.9k337.6k1](/packages/ccxt-ccxt)[voryx/pgasync

Async Reactive Postgres Driver for PHP (Non-blocking)

11295.9k4](/packages/voryx-pgasync)[clue/redis-react

Async Redis client implementation, built on top of ReactPHP.

28214.0M47](/packages/clue-redis-react)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136400.8k14](/packages/rector-rector-src)[react/mysql

Async MySQL database client for ReactPHP.

338442.6k30](/packages/react-mysql)[clue/docker-react

Async, event-driven access to the Docker Engine API, built on top of ReactPHP.

112160.9k1](/packages/clue-docker-react)

PHPackages © 2026

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