PHPackages                             prsw/ext-sqlx - 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. prsw/ext-sqlx

ActivePhp-ext[Database &amp; ORM](/categories/database)

prsw/ext-sqlx
=============

Async SQL database access via Rust sqlx

v0.1.2(1mo ago)01MITRustPHP &gt;=8.4

Since May 29Pushed 1mo agoCompare

[ Source](https://github.com/praswicaksono/ext-sqlx)[ Packagist](https://packagist.org/packages/prsw/ext-sqlx)[ RSS](/packages/prsw-ext-sqlx/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

sqlx-php
========

[](#sqlx-php)

An asynchronous SQL database extension for PHP, powered by the incredible Rust [`sqlx`](https://github.com/launchbadge/sqlx) library and bridged to PHP's `Revolt` event loop via `ext-php-rs`.

Enjoy non-blocking database queries in PHP using Tokio's ultra-fast multithreaded runtime.

### Features

[](#features)

- **Truly Async**: Your PHP event loop keeps ticking while heavy database queries run on Rust threads.
- **Multi-Database**: Built-in support for SQLite, MySQL/MariaDB, and PostgreSQL.
- **Streaming**: Stream massive query results efficiently back to PHP memory using Tokio MPSC channels.
- **Connection Pooling**: Automatic, configurable connection pools under the hood.

---

Installation
------------

[](#installation)

This extension is distributed as a pre-compiled binary via **PIE (PHP Installer for Extensions)**. You do not need Rust installed on your server to use this extension.

```
# Ensure you have pie installed, then run:
pie install prsw/sqlx-php
```

You must also require the PHP-side event loop dependencies in your project:

```
composer require amphp/amp revolt/event-loop
```

---

Quick Start
-----------

[](#quick-start)

You must initialize the Tokio bridge and register it with `Revolt` before queueing your database logic.

```
