PHPackages                             opis/database - 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. opis/database

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

opis/database
=============

A database abstraction layer over PDO, that provides a powerful and intuitive query builder, bundled with an easy to use schema builder

4.3.0(1y ago)10184.2k↑15.4%25[3 PRs](https://github.com/opis/database/pulls)3Apache-2.0PHPPHP ^7.0 || ^8.0

Since Dec 17Pushed 1y ago11 watchersCompare

[ Source](https://github.com/opis/database)[ Packagist](https://packagist.org/packages/opis/database)[ Docs](https://opis.io/database)[ RSS](/packages/opis-database/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (57)Used By (3)

Opis Database
=============

[](#opis-database)

[![Tests](https://github.com/opis/database/workflows/Tests/badge.svg)](https://github.com/opis/database/actions)[![Latest Stable Version](https://camo.githubusercontent.com/4aee0648651eee997c034a7d4af6a818669807b810be5d18ecdd04d3aad9d570/68747470733a2f2f706f7365722e707567782e6f72672f6f7069732f64617461626173652f76657273696f6e2e706e67)](https://packagist.org/packages/opis/database)[![Latest Unstable Version](https://camo.githubusercontent.com/df9d614ba1d16885a7bb7521ae8604091f1d25a324ed8b6a2ff8018ed671fcf2/68747470733a2f2f706f7365722e707567782e6f72672f6f7069732f64617461626173652f762f756e737461626c652e706e67)](https://packagist.org/packages/opis/database)[![License](https://camo.githubusercontent.com/d6dc99bf9e2d7f4f5babf5c84cf309ea49ae6a07bfde65b4a29a136def400fca/68747470733a2f2f706f7365722e707567782e6f72672f6f7069732f64617461626173652f6c6963656e73652e706e67)](https://packagist.org/packages/opis/database)

Database abstraction layer
--------------------------

[](#database-abstraction-layer)

**Opis Database** is a library that implements an abstraction layer over the PDO extension, by providing a powerful query builder along with an easy to use schema builder. The aim of the library is to provide an unified way of interacting with databases, no matter of the underlying relational database management system.

Currently, we are officially supporting MySQL, PostgreSQL, Microsoft SQL, and SQLite. We also provide experimental support - without any commitment regarding bug fixes and updates - for Firebird, IBM DB2, Oracle, and NuoDB query builder.

Documentation
-------------

[](#documentation)

The full documentation for this library can be found [here](https://opis.io/database)

License
-------

[](#license)

**Opis Database** is licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0 "Apache License")

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

[](#requirements)

- PHP 7 or higher
- PDO

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

[](#installation)

**Opis Database** is available on [Packagist](https://packagist.org/packages/opis/database "Packagist") and it can be installed from a command line interface by using [Composer](https://getcomposer.org "Composer").

```
composer require opis/database
```

Or you could directly reference it into your `composer.json` file as a dependency

```
{
    "require": {
        "opis/database": "^4.0"
    }
}
```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 92.1% 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 ~73 days

Recently: every ~425 days

Total

55

Last Release

596d ago

Major Versions

1.4.0 → 2.0.02014-10-15

2.3.1 → 3.0.02015-10-29

3.6.8 → 4.0-alpha.12017-06-27

3.6.x-dev → 4.0.02018-06-05

4.2.1 → 2020.x-dev2021-04-26

PHP version history (5 changes)1.0.0PHP &gt;=5.3.0

4.0-alpha.1PHP &gt;=7.0.0

4.0.1PHP ^7.0

2020.x-devPHP ^8.0

4.3.0PHP ^7.0 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/47afaf3c711dd321c8d09bae2afed928971ec9e9a7593c925749696f04d2fddd?d=identicon)[msarca](/maintainers/msarca)

![](https://www.gravatar.com/avatar/7c720b40eb280d9fd33cc35d74c34b3763c2777bd2502d094625faa367f0dca4?d=identicon)[sorinsarca](/maintainers/sorinsarca)

---

Top Contributors

[![msarca](https://avatars.githubusercontent.com/u/5808737?v=4)](https://github.com/msarca "msarca (667 commits)")[![sorinsarca](https://avatars.githubusercontent.com/u/3427195?v=4)](https://github.com/sorinsarca "sorinsarca (28 commits)")[![Neppord](https://avatars.githubusercontent.com/u/72190?v=4)](https://github.com/Neppord "Neppord (21 commits)")[![fkirkholt](https://avatars.githubusercontent.com/u/973839?v=4)](https://github.com/fkirkholt "fkirkholt (5 commits)")[![kenlog](https://avatars.githubusercontent.com/u/11728231?v=4)](https://github.com/kenlog "kenlog (1 commits)")[![barryhughes](https://avatars.githubusercontent.com/u/3594411?v=4)](https://github.com/barryhughes "barryhughes (1 commits)")[![adaojunior](https://avatars.githubusercontent.com/u/4921294?v=4)](https://github.com/adaojunior "adaojunior (1 commits)")

---

Tags

databaseopispdophpdatabasemysqlsqlitesqlqueryquery builderpostgreAbstraction Layerschema builder

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/opis-database/health.svg)

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

###  Alternatives

[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[cycle/database

DBAL, schema introspection, migration and pagination

64690.9k31](/packages/cycle-database)[pecee/pixie

Lightweight, fast query-builder for PHP based on Laravel Eloquent but with less overhead.

4128.7k8](/packages/pecee-pixie)[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)

PHPackages © 2026

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