PHPackages                             malu/medoo2 - 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. malu/medoo2

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

malu/medoo2
===========

The lightest PHP database framework to accelerate development

v2.1(5y ago)015MITPHPPHP &gt;=5.4

Since Feb 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/pingmalu/Medoo2)[ Packagist](https://packagist.org/packages/malu/medoo2)[ Docs](https://medoo.in)[ RSS](/packages/malu-medoo2/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

从 Medoo 1.6 改良，支持PHP8

> 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 malu/medoo2

```

And update the composer

```
$ composer update

```

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

// Using Medoo namespace
use Medoo2\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

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

1927d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ff05cdf110e416791444dc8161b7f799d7a0ce0cc711f2504a836d74df4a821e?d=identicon)[malu](/maintainers/malu)

---

Top Contributors

[![pingmalu](https://avatars.githubusercontent.com/u/7290204?v=4)](https://github.com/pingmalu "pingmalu (6 commits)")

---

Tags

databasemysqlsqlitepostgresqlmariadbsqlmssqloraclelightweightphp framework

### Embed Badge

![Health badge](/badges/malu-medoo2/health.svg)

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

###  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)
