PHPackages                             terminusstudio/ezdb - 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. terminusstudio/ezdb

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

terminusstudio/ezdb
===================

ezDB is a lightweight library that provides an easy and fast to deal with databases in PHP. It manages connections, provides a query builder, and a lightweight ORM.

1.0.0(3y ago)345[1 PRs](https://github.com/TerminusStudio/ezDB/pulls)MITPHPPHP ^8.1CI passing

Since Apr 29Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/TerminusStudio/ezDB)[ Packagist](https://packagist.org/packages/terminusstudio/ezdb)[ RSS](/packages/terminusstudio-ezdb/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (2)Versions (6)Used By (0)

ezDB
====

[](#ezdb)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bf1579cd9129873c3ba536f911df73f4bfff73f76d23d7b662d5a78de0538483/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f5465726d696e757353747564696f2f657a64622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/TerminusStudio/ezdb)[![Total Downloads](https://camo.githubusercontent.com/a29d4c3516de27e1f722cc1d908b8ab98cb99cb604f10aa777b552a9ce68caa4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f5465726d696e757353747564696f2f657a64622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/TerminusStudio/ezdb)[![ezDB Tests](https://github.com/TerminusStudio/ezDB/workflows/ezDB%20Tests/badge.svg?branch=main)](https://github.com/TerminusStudio/ezDB/actions/?query=branch:main)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Notice
======

[](#notice)

This branch contains the latest release of ezDB v1.0. This version is not fully compatible with v0.1 and is also not fully compatible with Laravel Eloquent.

v1.0 only supports PHP 8.1, and it should support PHP 8.2 on release.

Please find [v0.1 from here](https://github.com/TerminusStudio/ezDB/tree/0.1.0).

Description
===========

[](#description)

ezDB is a lightweight library that provides an easy and fast to deal with databases in PHP. It manages connections, provides a query builder, and a lightweight ORM.

*This project was inspired by [ezSQL](https://github.com/ezSQL/ezsql) and [Laravel Eloquent](https://github.com/illuminate/database). It borrows most of its syntax from Eloquent and I would like to thank all the awesome developers that worked have worked on it.*

The ORM in this library is lightweight and focuses on providing basic functionalities. If you require more functions you can easily extend the library or use a PHP ORM like [DoctrineORM](https://github.com/doctrine/orm).

Install
=======

[](#install)

With Composer
-------------

[](#with-composer)

ezDB can be installed using composer by running the command below,

```
composer require terminusstudio/ezdb

```

and require the `autoload.php` file in your script.

```
require_once __DIR__ . '/vendor/autoload.php';
```

Without Composer
----------------

[](#without-composer)

ezDB can also be included manually. This is very useful for simple projects that only wants to use ezDB for managing database connections.

Follow the steps below:

1. Download the latest [release from here](https://github.com/TerminusStudio/ezDB/releases/).
2. Extract the **ezDB** folder to your project.
3. In your program include the following line,

```
require_once '/load.php';
```

4. This will include all the files that are necessary for ezDB to function. To improve performance, create a copy of load.php and include only the classes that you will use.

How ezDB Works
==============

[](#how-ezdb-works)

ezDB can be seperated into three different parts,

1. [Builder](https://github.com/TerminusStudio/ezDB/wiki/2.-Builder)
2. [Connection](https://github.com/TerminusStudio/ezDB/wiki/1.-Connection)
3. [Model](https://github.com/TerminusStudio/ezDB/wiki/3.-Model)

The Builder (along with the Processor) are at the core of ezDB. They support generating the SQL queries from code.

The Connection classes allow you to manage database connections using multiple drivers and processors. Support queries, prepared statements etc. A global class manages as many connection to as many database as you need. The connections class also supports the `IConnectionAwareBuilder` which extends the builders and provides support to directly interact with the database from the builder.

Finally, the Model layer provides a basic ORM and is also capable of managing relationships. It uses the Connection classes, and it's custom builders, `ModelAwareBuilder` (which extends from `ConnectionAwareBuilder`) and `RelationshipBuilder`. It supports more features like timestamps, relationship querying, eager loading etc.

License
=======

[](#license)

Copyright © Terminus Studio

Licensed under the MIT license, see [LICENSE.md](https://github.com/TerminusStudio/ezDB/blob/dev/License.md) for details.

###  Health Score

38

↑

LowBetter than 86% of packages

Maintenance59

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Total

3

Last Release

1358d ago

Major Versions

0.1.x-dev → 1.0.02022-07-03

PHP version history (2 changes)0.1.0PHP ^7.3 || ^8.0

1.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/95e61a306731fe02105f27227175648acf48b0faf004969189a30616c48449e3?d=identicon)[Sugavanas](/maintainers/Sugavanas)

---

Top Contributors

[![Sugavanas](https://avatars.githubusercontent.com/u/8426015?v=4)](https://github.com/Sugavanas "Sugavanas (160 commits)")

---

Tags

mysqliormpdo-mysqlphpphp7php8phpdatabaseormmysqlpdo

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/terminusstudio-ezdb/health.svg)

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

###  Alternatives

[ifsnop/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k5.4M60](/packages/ifsnop-mysqldump-php)[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.8k](/packages/clouddueling-mysqldump-php)[riverside/php-orm

PHP ORM micro-library and query builder

121.2k](/packages/riverside-php-orm)[popphp/pop-db

Pop Db Component for Pop PHP Framework

1814.1k9](/packages/popphp-pop-db)

PHPackages © 2026

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