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

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

dandylion/medoo
===============

The lightweight PHP database framework to accelerate development

v2.3.2(1y ago)01031MITPHPPHP &gt;=7.3

Since Oct 20Pushed 1y agoCompare

[ Source](https://github.com/dandylion-tech/medoo)[ Packagist](https://packagist.org/packages/dandylion/medoo)[ Docs](https://medoo.in)[ Fund](https://paypal.me/AngelaonLai)[ Fund](https://opencollective.com/medoo)[ RSS](/packages/dandylion-medoo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (1)Versions (10)Used By (1)

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

 [![Build Status](https://github.com/catfan/Medoo/actions/workflows/php.yml/badge.svg)](https://github.com/catfan/Medoo/actions) [![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) [![Backers on Open Collective](https://camo.githubusercontent.com/520d95988ba73be643291a4dc3425d0c437587bfa82ac39e242acce4bb256eb3/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f4d65646f6f2f6261636b6572732f62616467652e737667)](https://opencollective.com/medoo) [![Sponsors on Open Collective](https://camo.githubusercontent.com/688f309e2c48706b7a078f51b0ac45fba91680627ba78b16e3cf167c9746f928/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f4d65646f6f2f73706f6e736f72732f62616467652e737667) ](https://opencollective.com/medoo)

> The lightweight PHP database framework to accelerate development.

Features
--------

[](#features)

- **Lightweight** - Portable with only one file.
- **Easy** - Easy to learn and use, with a friendly construction.
- **Powerful** - Supports various common and complex SQL queries, data mapping and prevents SQL injection.
- **Compatible** - Supports MySQL, MSSQL, SQLite, MariaDB, PostgreSQL, Sybase, Oracle, and more.
- **Friendly** - Works well with every PHP framework, such as Laravel, Codeigniter, Yii, Slim, and frameworks that support singleton extension or composer.
- **Free** - Under the MIT license, you can use it anywhere, for whatever purpose.

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

[](#requirements)

PHP 7.3+ and installed PDO extension.

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

[](#get-started)

### Install via composer

[](#install-via-composer)

Add Medoo to the composer.json configuration file.

```
$ composer require catfan/medoo

```

And update the composer

```
$ composer update

```

```
// Require Composer's autoloader.
require 'vendor/autoload.php';

// Use the Medoo namespace.
use Dandylion\Medoo;

// Connect to the database.
$database = new Medoo([
    'type' => 'mysql',
    'host' => 'localhost',
    'database' => 'name',
    'username' => 'your_username',
    'password' => 'your_password'
]);

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

Before starting a new pull request, please ensure compatibility with other databases and write unit tests whenever possible.

Run `phpunit tests` for unit testing and `php-cs-fixer fix` to fix code style.

Each commit should start with a tag indicating the type of change: `[fix]`, `[feature]`, or `[update]`.

Please keep it simple and keep it clear.

License
-------

[](#license)

Medoo is released under the MIT license.

Links
-----

[](#links)

- Official website:
- Documentation:
- Twitter:
- Open Collective:

Support Our Other Product
-------------------------

[](#support-our-other-product)

[Gear Browser - Web Browser for Geek](https://gear4.app)

[![Gear Browser](https://camo.githubusercontent.com/97c8fc9b97536b579276f559b0d594afe0a458718be8a938186756fb049b0089/68747470733a2f2f6769746875622d70726f64756374696f6e2d757365722d61737365742d3632313064662e73332e616d617a6f6e6177732e636f6d2f313436373930342f3234303130323833392d61353937393732632d343538612d346630652d396566382d6434616431306261303639302e706e67)](https://gear4.app)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.3% 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 ~32 days

Recently: every ~58 days

Total

9

Last Release

673d ago

Major Versions

v1.1 → v2.12023-11-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/575a36791d501229a6828d097ef5ecbc7714d346b707a67e8e71fd2e42b92e43?d=identicon)[Dandylion](/maintainers/Dandylion)

---

Top Contributors

[![catfan](https://avatars.githubusercontent.com/u/1467904?v=4)](https://github.com/catfan "catfan (466 commits)")[![Angelaon](https://avatars.githubusercontent.com/u/13937887?v=4)](https://github.com/Angelaon "Angelaon (173 commits)")[![Codey-Miller](https://avatars.githubusercontent.com/u/19665859?v=4)](https://github.com/Codey-Miller "Codey-Miller (12 commits)")[![qatrix](https://avatars.githubusercontent.com/u/1537121?v=4)](https://github.com/qatrix "qatrix (5 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)")[![SyuTingSong](https://avatars.githubusercontent.com/u/680340?v=4)](https://github.com/SyuTingSong "SyuTingSong (1 commits)")[![tianyiw2013](https://avatars.githubusercontent.com/u/4644588?v=4)](https://github.com/tianyiw2013 "tianyiw2013 (1 commits)")[![jackled](https://avatars.githubusercontent.com/u/2091208?v=4)](https://github.com/jackled "jackled (1 commits)")[![etrappg](https://avatars.githubusercontent.com/u/17647359?v=4)](https://github.com/etrappg "etrappg (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)")[![jfcherng](https://avatars.githubusercontent.com/u/6594915?v=4)](https://github.com/jfcherng "jfcherng (1 commits)")[![r0manchak](https://avatars.githubusercontent.com/u/4974042?v=4)](https://github.com/r0manchak "r0manchak (1 commits)")[![shea-sollars](https://avatars.githubusercontent.com/u/2511672?v=4)](https://github.com/shea-sollars "shea-sollars (1 commits)")

---

Tags

databasemysqlsqlitepostgresqlmariadbsqlmssqloraclelightweightphp frameworkdatabase library

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[catfan/medoo

The lightweight PHP database framework to accelerate development

4.9k1.5M193](/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)
