PHPackages                             sirmerdas/sparkle - 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. sirmerdas/sparkle

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

sirmerdas/sparkle
=================

A simple and flexible PHP Database Abstraction Layer for managing database interactions with ease.

v1.0.5(1y ago)56[2 issues](https://github.com/sirmerdas/sparkle/issues)MITPHPPHP ^8.3CI passing

Since Mar 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sirmerdas/sparkle)[ Packagist](https://packagist.org/packages/sirmerdas/sparkle)[ RSS](/packages/sirmerdas-sparkle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (5)Versions (8)Used By (0)

[![Sparkle](./img/banner.jpg)](./img/banner.jpg)

Sparkle – A Lightweight Database Abstraction Layer for PHP
==========================================================

[](#sparkle--a-lightweight-database-abstraction-layer-for-php)

**For full documentation, visit [sparkle.sirmerdas.ir](https://sparkle.sirmerdas.ir)**.

[![Latest Stable Version](https://camo.githubusercontent.com/ced78db06d0c19f85f4103be37511e01d392983ac8bc13e800840926fb075dd0/687474703a2f2f706f7365722e707567782e6f72672f7369726d65726461732f737061726b6c652f76)](https://packagist.org/packages/sirmerdas/sparkle) [![Total Downloads](https://camo.githubusercontent.com/faf60df85094845988a277163901663e37b329c18d60f639198bdf1f583f0d9f/687474703a2f2f706f7365722e707567782e6f72672f7369726d65726461732f737061726b6c652f646f776e6c6f616473)](https://packagist.org/packages/sirmerdas/sparkle) [![License](https://camo.githubusercontent.com/5fea65a40fc550f690936cd9e26e91d50fe51a567436eb5973bf99b1215944a9/687474703a2f2f706f7365722e707567782e6f72672f7369726d65726461732f737061726b6c652f6c6963656e7365)](https://packagist.org/packages/sirmerdas/sparkle) [![PHP Version Require](https://camo.githubusercontent.com/db408c70e66d2bd7164d35609ce8f4d7c86875e02e2f9351e1b40e824e9b14ba/687474703a2f2f706f7365722e707567782e6f72672f7369726d65726461732f737061726b6c652f726571756972652f706870)](https://packagist.org/packages/sirmerdas/sparkle)

**Sparkle** is a simple yet expressive **Database Abstraction Layer (DAL)** for PHP, highly inspired by Laravel's **Eloquent**. However, unlike Eloquent, which is a full-fledged **Object-Relational Mapper (ORM)**, Sparkle is a lightweight **query builder** designed for direct interaction with **PDO** while keeping things minimal and efficient.

If you love **Eloquent's fluent syntax** but need something **lighter and more flexible**, Sparkle is the perfect fit.

🔥 Features
----------

[](#-features)

✅ **Fluent Query Builder** – Write queries effortlessly using a clean and expressive syntax.
✅ **Lightweight &amp; Fast** – No heavy ORM, just raw performance with a structured API.
✅ **Built on PDO** – Fully utilizes PHP’s native **PDO** for database interactions.
✅ **Transactions Support** – Handle database transactions with ease.
✅ **Error Handling &amp; Logging** – Catch SQL errors and log them when needed.
✅ **Raw Queries** – Run custom SQL queries with parameter binding.
✅ **Flexible &amp; Extensible** – Easily integrates into any PHP project.

🚀Installation
-------------

[](#installation)

You can install Sparkle via Composer:

```
composer require sirmerdas/sparkle
```

Why Sparkle?
------------

[](#why-sparkle)

While **Laravel Eloquent** is a powerful **ORM** with advanced features like model relationships, mutators, and events, **Sparkle** is a much simpler **DAL** that focuses only on **query building and execution**. It's perfect for projects where you don’t need the overhead of a full ORM but still want a structured and expressive way to interact with your database.

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Total

6

Last Release

404d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

databasedatabase-abstraction-layermysqlpdophpphp-packagequery-builderdatabase

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sirmerdas-sparkle/health.svg)

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

###  Alternatives

[wazaari/monolog-mysql

A handler for Monolog that sends messages to MySQL

140884.1k6](/packages/wazaari-monolog-mysql)[bradmkjr/monolog-wordpress

A handler for Monolog that sends messages to MySQL via WordPress Functions

2817.1k](/packages/bradmkjr-monolog-wordpress)[nkiraly/dbsteward

SQL database definition differencing tool. Structure and data is defined in a DTD-enforced, human-readable XML format. Outputs transactional SQL statement files to apply your changes.

504.2k](/packages/nkiraly-dbsteward)[karelwintersky/monolog-pdo-handler

A handler for Monolog that stores data via PDO driver to Database

109.0k1](/packages/karelwintersky-monolog-pdo-handler)

PHPackages © 2026

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