PHPackages                             mouf/magic-query - 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. mouf/magic-query

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

mouf/magic-query
================

A very clever library to help you with SQL: generate prepared statements with a variable number of parameters, automatically writes joins... and much more!

v2.0.0(11mo ago)22256.8k—5.9%[6 PRs](https://github.com/thecodingmachine/magic-query/pulls)3MITPHP ^7.4 || ^8.0

Since Sep 17Compare

[ Source](https://github.com/thecodingmachine/magic-query)[ Packagist](https://packagist.org/packages/mouf/magic-query)[ Docs](http://mouf-php.com/packages/mouf/magic-query)[ RSS](/packages/mouf-magic-query/feed)WikiDiscussions Synced 1mo ago

READMEChangelogDependencies (12)Versions (44)Used By (3)

### README not available

The README for this package hasn't been synced yet. View it on [GitHub](https://github.com/thecodingmachine/magic-query).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance51

Moderate activity, may be stable

Popularity41

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 80.7% 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 ~82 days

Recently: every ~116 days

Total

44

Last Release

344d ago

Major Versions

v1.5.0 → v2.0.0-beta.12023-01-12

v1.5.2 → v2.0.0-beta.22024-06-08

PHP version history (3 changes)1.0.x-devPHP &gt;=5.3.0

v1.3.0PHP &gt;=7.1.0

v1.5.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104771?v=4)[mouf](/maintainers/mouf)[@Mouf](https://github.com/Mouf)

---

Top Contributors

[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (196 commits)")[![homersimpsons](https://avatars.githubusercontent.com/u/16977446?v=4)](https://github.com/homersimpsons "homersimpsons (19 commits)")[![cbalda](https://avatars.githubusercontent.com/u/6704490?v=4)](https://github.com/cbalda "cbalda (7 commits)")[![TheoBiron](https://avatars.githubusercontent.com/u/7087053?v=4)](https://github.com/TheoBiron "TheoBiron (5 commits)")[![dsavina](https://avatars.githubusercontent.com/u/22031211?v=4)](https://github.com/dsavina "dsavina (4 commits)")[![dalibert42](https://avatars.githubusercontent.com/u/19168056?v=4)](https://github.com/dalibert42 "dalibert42 (3 commits)")[![xhuberty](https://avatars.githubusercontent.com/u/8350192?v=4)](https://github.com/xhuberty "xhuberty (2 commits)")[![nguyenk](https://avatars.githubusercontent.com/u/2227554?v=4)](https://github.com/nguyenk "nguyenk (2 commits)")[![Zheness](https://avatars.githubusercontent.com/u/5830103?v=4)](https://github.com/Zheness "Zheness (1 commits)")[![Denis74RUS](https://avatars.githubusercontent.com/u/4632718?v=4)](https://github.com/Denis74RUS "Denis74RUS (1 commits)")[![HugoAverty](https://avatars.githubusercontent.com/u/1681508?v=4)](https://github.com/HugoAverty "HugoAverty (1 commits)")[![mhtghn](https://avatars.githubusercontent.com/u/19688842?v=4)](https://github.com/mhtghn "mhtghn (1 commits)")[![aszenz](https://avatars.githubusercontent.com/u/25319264?v=4)](https://github.com/aszenz "aszenz (1 commits)")

---

Tags

databasequerymouf

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mouf-magic-query/health.svg)

```
[![Health](https://phpackages.com/badges/mouf-magic-query/health.svg)](https://phpackages.com/packages/mouf-magic-query)
```

###  Alternatives

[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[envms/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

925511.7k13](/packages/envms-fluentpdo)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[lichtner/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

921274.8k6](/packages/lichtner-fluentpdo)[bvanhoekelen/performance

PHP performance tool analyser your script on time, memory usage and db query. Support Laravel and Composer for web, web console and command line interfaces.

521774.3k4](/packages/bvanhoekelen-performance)[fpdo/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

921244.9k7](/packages/fpdo-fluentpdo)

PHPackages © 2026

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