PHPackages                             erikthiart/dbease - 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. erikthiart/dbease

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

erikthiart/dbease
=================

A lightweight database abstraction library for simplifying database operations.

v1.2.0(2y ago)56GPL-3.0-or-laterPHPPHP &gt;=7.2

Since Oct 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ErikThiart/DBease)[ Packagist](https://packagist.org/packages/erikthiart/dbease)[ RSS](/packages/erikthiart-dbease/feed)WikiDiscussions main Synced 1mo ago

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

DBease: A Lightweight Database Abstraction Library for MySQL
============================================================

[](#dbease-a-lightweight-database-abstraction-library-for-mysql)

[![License](https://camo.githubusercontent.com/53d59a820ad1447bec0c77cd5f1725b0040c5e7d32aec6a4115ede03ddfb06de/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d474e552d626c75652e737667)](LICENSE)[![Latest Version](https://camo.githubusercontent.com/360e6dc865f0ed028047d9e4eb0050df89810932df524b79ade6ca880642e894/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6572696b7468696172742f646265617365)](https://github.com/erikthiart/dbease/releases)[![Packagist](https://camo.githubusercontent.com/ef51ef5140e92077faa9cd55b73d1147f60d63edbaad48cadadf1e8bb73d014c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6572696b7468696172742f646265617365)](https://packagist.org/packages/erikthiart/dbease)[![GitHub Issues](https://camo.githubusercontent.com/2de4f929a2fc5b39b250b9a26f0da676edfe40e624e14df13f03ef808dbd365a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6572696b7468696172742f646265617365)](https://github.com/erikthiart/dbease/issues)

DBease is a lightweight and easy-to-use PHP database abstraction library designed for MySQL, using the power of PDO. It simplifies common database operations and offers a flexible query builder, making it a valuable tool for developers who want to interact with databases efficiently.

Features
--------

[](#features)

- **Simplified CRUD Operations:** Perform Create, Read, Update, and Delete (CRUD) operations with ease.
- **Flexible Query Builder:** Build complex queries with a fluent interface.
- **Custom SQL Execution:** Execute raw SQL queries when needed.
- **Exception Handling:** Robust error handling with detailed exceptions.
- **Query Logging:** Keep track of executed queries for debugging.
- **Table and Column Existence Checks:** Verify the existence of tables and columns.
- **Composer-Friendly:** Easily install and manage using Composer.

Installation
------------

[](#installation)

DBease can be installed via [Composer](https://getcomposer.org/):

```
composer require erikthiart/dbease
```

Getting Started
---------------

[](#getting-started)

### Initialize DBease

[](#initialize-dbease)

```
use DBease\Database;

// Initialize the database connection
$db = new Database();
```

### Insert Data

[](#insert-data)

```
$data = [
    'name' => 'John Doe',
    'email' => 'john@example.com',
    'age' => 30,
];

// Insert into the 'users' table
$db->insert('users', $data);
```

### Update Data

[](#update-data)

```
$updateData = ['status' => 'active'];

// Update records in the 'users' table where 'id' is 1
$db->update('users', $updateData, ['id' => 1]);
```

### Query Data

[](#query-data)

```
// Find a single record from the 'users' table where 'id' is 1
$user = $db->find('users', ['id' => 1]);

// Find all active users
$activeUsers = $db->findAll('users', ['status' => 'active']);
```

### Execute Raw SQL

[](#execute-raw-sql)

```
// Execute a custom SQL query
$sql = "SELECT * FROM products WHERE category = :category";
$params = ['category' => 'Electronics'];
$results = $db->raw($sql, $params);
```

### Query Builder

[](#query-builder)

```
// Build complex queries
$results = $db
    ->select('name, price')
    ->limit(5)
    ->offset(10)
    ->fetchWithOffset('products', ['category' => 'Electronics']);
```

### More Examples and Documentation

[](#more-examples-and-documentation)

For more examples and detailed documentation, please refer to the [DBease Wiki](https://github.com/erikthiart/dbease/wiki).

Contributing
------------

[](#contributing)

Contributions are welcome! Please check the [contribution guidelines](CONTRIBUTING.md) for details.

License
-------

[](#license)

DBease is open-source software licensed under the [GNU General Public License](LICENSE).

Credits
-------

[](#credits)

DBease is developed and maintained by Erik Thiart.

Support
-------

[](#support)

If you have questions or need assistance, feel free to [open an issue](https://github.com/erikthiart/dbease/issues).

---

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

958d ago

### Community

Maintainers

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

---

Top Contributors

[![ErikThiart](https://avatars.githubusercontent.com/u/9626641?v=4)](https://github.com/ErikThiart "ErikThiart (8 commits)")

### Embed Badge

![Health badge](/badges/erikthiart-dbease/health.svg)

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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