PHPackages                             sobhanmohammadi/arxaron - 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. sobhanmohammadi/arxaron

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

sobhanmohammadi/arxaron
=======================

Arxaron — a secure, robust, high-performance PHP database library built directly on mysqli (no PDO), with a fluent query builder, active-record models, transactions, and optional Redis (predis) caching.

v0.0.1(today)01↑2900%MITPHPPHP &gt;=8.3

Since Aug 1Pushed todayCompare

[ Source](https://github.com/sobhanmohammadi-dev/arxaron)[ Packagist](https://packagist.org/packages/sobhanmohammadi/arxaron)[ RSS](/packages/sobhanmohammadi-arxaron/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (2)Used By (0)

Arxaron
=======

[](#arxaron)

**Package:** `sobhanmohammadi/arxaron`

A secure, robust, and performant database library for PHP 8.3, 8.4, and 8.5 — built directly on **`mysqli`** (never PDO), with a fluent query builder, an optional active-record layer, real transactions with savepoints, and first-class **Redis** query caching via **`predis/predis`**.

> 📖 **See [`docs/GUIDE.md`](docs/GUIDE.md) for the complete, in-depth usage guide** — every method, every config option, transactions, caching, security model, troubleshooting, and a full end-to-end example. This README is just a quick start.

Why this exists
---------------

[](#why-this-exists)

- **`mysqli`-only.** No PDO anywhere in the stack, including for prepared statements — everything goes through `mysqli_stmt`.
- **Security by construction.** All values are bound as prepared-statement parameters. Table/column names are validated against a strict whitelist pattern and backtick-quoted. `update()`/`delete()` refuse to run without a `WHERE` clause unless you explicitly opt out.
- **Robust.** Automatic, bounded reconnect-and-retry on transient errors ("MySQL server has gone away"), nested transactions via `SAVEPOINT`, deadlock-aware transaction retries, and connection error messages that never leak credentials.
- **Fast.** Prepared statement reuse per call, buffered or streamed (`cursor()`) result fetching, and an optional Redis cache layer with tag-based invalidation that fails open (a cache outage never breaks your app — it just stops caching).
- **PHP 8.3 – 8.5 compatible.** Uses only stable, non-deprecated APIs (readonly properties, enums-free, `match`, named arguments) so it runs unmodified across the 8.3/8.4/8.5 line.

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

[](#installation)

```
composer require sobhanmohammadi/arxaron

# Optional, only if you want Redis-backed caching:
composer require predis/predis
```

Quick start
-----------

[](#quick-start)

```
use Arxaron\Config;
use Arxaron\Database;

Database::addConnection(Config::fromArray([
    'host'     => '127.0.0.1',
    'username' => 'app',
    'password' => getenv('DB_PASSWORD'),
    'database' => 'shop',
    'charset'  => 'utf8mb4',
]));

// Optional: enable Redis-backed query caching (uses predis/predis).
Database::useRedisCache(new Predis\Client([
    'scheme' => 'tcp',
    'host'   => '127.0.0.1',
    'port'   => 6379,
]));

// Fluent query builder
$activeUsers = Database::table('users')
    ->select('id', 'name', 'email')
    ->where('active', '=', 1)
    ->orderBy('created_at', 'DESC')
    ->limit(20)
    ->get();

foreach ($activeUsers as $row) {
    echo $row['name'], "\n";
}

// Raw parameterized SQL (positional or named placeholders)
$row = Database::query('SELECT * FROM users WHERE email = :email', [
    'email' => 'ada@example.com',
])->first();
```

Query builder
-------------

[](#query-builder)

```
Database::table('orders')
    ->select('orders.id', 'orders.total', 'customers.name')
    ->join('customers', 'orders.customer_id', '=', 'customers.id')
    ->where('orders.status', '=', 'paid')
    ->whereBetween('orders.created_at', $start, $end)
    ->whereIn('orders.region', ['EU', 'UK'])
    ->orWhere('orders.priority', '=', 'high')
    ->groupBy('customers.id')
    ->having('SUM(orders.total)', '>', 1000)
    ->orderBy('orders.total', 'DESC')
    ->paginate(page: 2, perPage: 25)
    ->get();
```

Grouped conditions:

```
Database::table('products')
    ->where('active', '=', 1)
    ->whereGroup(function ($q) {
        $q->where('price', ' false`, preventing PHP object-injection even if a cache backend were ever compromised.

Requirements
------------

[](#requirements)

- PHP 8.3, 8.4, or 8.5
- `ext-mysqli`
- `predis/predis` ^2.2 or ^3.0 (only if you use Redis caching)

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e87e0310dfd6b9383486168b87122fb28cd8283adae26ddc290786408080cee?d=identicon)[sobhanmohammadi-dev](/maintainers/sobhanmohammadi-dev)

---

Top Contributors

[![sobhanmohammadi-dev](https://avatars.githubusercontent.com/u/200896399?v=4)](https://github.com/sobhanmohammadi-dev "sobhanmohammadi-dev (1 commits)")

---

Tags

databaseormredispredismysqliquery builderphp85php8.3php84

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sobhanmohammadi-arxaron/health.svg)

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

###  Alternatives

[cycle/database

DBAL, schema introspection, migration and pagination

71811.3k65](/packages/cycle-database)[wayofdev/laravel-cycle-orm-adapter

🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.

3642.5k3](/packages/wayofdev-laravel-cycle-orm-adapter)

PHPackages © 2026

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