PHPackages                             jiaojie/medoo - 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. jiaojie/medoo

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

jiaojie/medoo
=============

The lightest PHP database framework to accelerate development

v1.5.4.3(8y ago)018MITPHPPHP &gt;=5.4

Since Apr 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jiaojie1989/Medoo)[ Packagist](https://packagist.org/packages/jiaojie/medoo)[ Docs](https://medoo.in)[ RSS](/packages/jiaojie-medoo/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (29)Used By (0)

 [![](https://cloud.githubusercontent.com/assets/1467904/19835326/ca62bc36-9ebd-11e6-8b37-7240d76319cd.png)](https://medoo.in)

 [![Total Downloads](https://camo.githubusercontent.com/3dce6baaf3cb26a833cb74207d4e5d74fa0cf7616e32c5978cec6b2847c00ff9/68747470733a2f2f706f7365722e707567782e6f72672f63617466616e2f6d65646f6f2f646f776e6c6f616473)](https://packagist.org/packages/catfan/medoo) [![Latest Stable Version](https://camo.githubusercontent.com/291718728d8bb78ec36c6177f5c796f492adc9bd831bc0f4d003069236e2b6c9/68747470733a2f2f706f7365722e707567782e6f72672f63617466616e2f6d65646f6f2f762f737461626c65)](https://packagist.org/packages/catfan/medoo) [![License](https://camo.githubusercontent.com/b5dfa225aabc9f43efb0c3ffdf064f11f1ee28f736bc3d78ec30f7fd25f12408/68747470733a2f2f706f7365722e707567782e6f72672f63617466616e2f6d65646f6f2f6c6963656e7365)](https://packagist.org/packages/catfan/medoo)

> The Lightest PHP database framework to accelerate development

Features
--------

[](#features)

- **Lightweight** - Less than 100 KB, portable with only one file
- **Easy** - Extremely easy to learn and use, friendly construction
- **Powerful** - Supports various common and complex SQL queries, data mapping, and prevent SQL injection
- **Compatible** - Supports all SQL databases, including MySQL, MSSQL, SQLite, MariaDB, PostgreSQL, Sybase, Oracle and more
- **Friendly** - Works well with every PHP frameworks, like Laravel, Codeigniter, Yii, Slim, and framework which supports singleton extension or composer
- **Free** - Under MIT license, you can use it anywhere whatever you want

Requirement
-----------

[](#requirement)

PHP 5.4+ and PDO extension installed

Get Started
-----------

[](#get-started)

### Install via composer

[](#install-via-composer)

Add Medoo to composer.json configuration file.

```
$ composer require catfan/Medoo

```

And update the composer

```
$ composer update

```

```
// If you installed via composer, just use this code to requrie autoloader on the top of your projects.
require 'vendor/autoload.php';

// Using Medoo namespace
use Medoo\Medoo;

// Initialize
$database = new Medoo([
    'database_type' => 'mysql',
    'database_name' => 'name',
    'server' => 'localhost',
    'username' => 'your_username',
    'password' => 'your_password'
]);

// Enjoy
$database->insert('account', [
    'user_name' => 'foo',
    'email' => 'foo@bar.com'
]);

$data = $database->select('account', [
    'user_name',
    'email'
], [
    'user_id' => 50
]);

echo json_encode($data);

// [
//     {
//         "user_name" : "foo",
//         "email" : "foo@bar.com",
//     }
// ]
```

Contribution Guides
-------------------

[](#contribution-guides)

For most of time, Medoo is using develop branch for adding feature and fixing bug, and the branch will be merged into master branch while releasing a public version. For contribution, submit your code to the develop branch, and start a pull request into it.

On develop branch, each commits are started with `[fix]`, `[feature]` or `[update]` tag to indicate the change.

Keep it simple and keep it clear.

License
-------

[](#license)

Medoo is under the MIT license.

Links
-----

[](#links)

- Official website:
- Documentation:

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 91.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 ~52 days

Recently: every ~4 days

Total

27

Last Release

3042d ago

Major Versions

v0.9.8 → v1.02015-10-05

PHP version history (2 changes)v0.9.5.3PHP &gt;=5.1

v1.2PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/603167de95d08f2a3edaf5acc3545be0e293566e84bddf4e9b5010aa0e52f6f3?d=identicon)[jiaojie1989](/maintainers/jiaojie1989)

---

Top Contributors

[![catfan](https://avatars.githubusercontent.com/u/1467904?v=4)](https://github.com/catfan "catfan (398 commits)")[![Angelaon](https://avatars.githubusercontent.com/u/13937887?v=4)](https://github.com/Angelaon "Angelaon (15 commits)")[![qatrix](https://avatars.githubusercontent.com/u/1537121?v=4)](https://github.com/qatrix "qatrix (5 commits)")[![jiaojie1989](https://avatars.githubusercontent.com/u/8794115?v=4)](https://github.com/jiaojie1989 "jiaojie1989 (4 commits)")[![IfnotFr](https://avatars.githubusercontent.com/u/1242308?v=4)](https://github.com/IfnotFr "IfnotFr (3 commits)")[![indiwine](https://avatars.githubusercontent.com/u/5175217?v=4)](https://github.com/indiwine "indiwine (2 commits)")[![utopiaio](https://avatars.githubusercontent.com/u/2365328?v=4)](https://github.com/utopiaio "utopiaio (2 commits)")[![jackled](https://avatars.githubusercontent.com/u/2091208?v=4)](https://github.com/jackled "jackled (1 commits)")[![glenndavey83](https://avatars.githubusercontent.com/u/6992344?v=4)](https://github.com/glenndavey83 "glenndavey83 (1 commits)")[![amoydavid](https://avatars.githubusercontent.com/u/734190?v=4)](https://github.com/amoydavid "amoydavid (1 commits)")[![r0manchak](https://avatars.githubusercontent.com/u/4974042?v=4)](https://github.com/r0manchak "r0manchak (1 commits)")[![SyuTingSong](https://avatars.githubusercontent.com/u/680340?v=4)](https://github.com/SyuTingSong "SyuTingSong (1 commits)")

---

Tags

databasemysqlsqlitepostgresqlmariadbsqlmssqloraclelightweightphp framework

### Embed Badge

![Health badge](/badges/jiaojie-medoo/health.svg)

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

###  Alternatives

[catfan/medoo

The lightweight PHP database framework to accelerate development

4.9k1.5M194](/packages/catfan-medoo)[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[tommyknocker/pdo-database-class

Framework-agnostic PHP database library with unified API for MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, and Oracle. Query Builder, caching, sharding, window functions, CTEs, JSON, migrations, ActiveRecord, CLI tools, AI-powered analysis. Zero external dependencies.

845.7k](/packages/tommyknocker-pdo-database-class)[ramadan/easy-model

A Laravel package for enjoyably managing database queries.

101.6k](/packages/ramadan-easy-model)

PHPackages © 2026

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