PHPackages                             eclipxe/engineworks-dbal - 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. eclipxe/engineworks-dbal

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

eclipxe/engineworks-dbal
========================

PHP Database Abstraction Layer

v2.3.7(5mo ago)31.8k12MITPHPPHP &gt;=7.3CI passing

Since Sep 1Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/eclipxe13/engineworks-dbal)[ Packagist](https://packagist.org/packages/eclipxe/engineworks-dbal)[ Docs](https://github.com/eclipxe13/engineworks-dbal)[ RSS](/packages/eclipxe-engineworks-dbal/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (33)Used By (2)

eclipxe/engineworks-dbal - Database Abstraction Layer
=====================================================

[](#eclipxeengineworks-dbal---database-abstraction-layer)

[![Source Code](https://camo.githubusercontent.com/79d47d5bd89de73be94a19c8d95c82f9525f6f993f2e32c8fabcee888cbdff94/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d65636c6970786531332f656e67696e65776f726b732d2d6462616c2d626c75653f6c6f676f3d676974687562)](https://github.com/eclipxe13/engineworks-dbal)[![Packagist PHP Version Support](https://camo.githubusercontent.com/2dad5236564d1da6a3d1289cbe6bff644cae321264263202621592d67a195320/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f65636c697078652f656e67696e65776f726b732d6462616c3f6c6f676f3d706870)](https://packagist.org/packages/eclipxe/engineworks-dbal)[![Latest Version](https://camo.githubusercontent.com/36eb7136c257821e61cf97d81805ea4acf4ac8fe93fb8d48641815cd1a992956/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f65636c6970786531332f656e67696e65776f726b732d6462616c3f6c6f676f3d676974)](https://github.com/eclipxe13/engineworks-dbal/releases)[![Software License](https://camo.githubusercontent.com/0caae80c42380cde5b3f673ca77908d4c8b77baf769ccdacd9ca52982a8cf508/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f65636c6970786531332f656e67696e65776f726b732d6462616c3f6c6f676f3d6f70656e2d736f757263652d696e6974696174697665)](https://github.com/eclipxe13/engineworks-dbal/blob/main/LICENSE)[![Build Status](https://camo.githubusercontent.com/73600585292157cdb0df68b605435750a70d420afd2f1346d95b1e0094bf0dc6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f65636c6970786531332f656e67696e65776f726b732d6462616c2f6275696c642e796d6c3f6272616e63683d6d61696e266c6f676f3d6769746875622d616374696f6e73)](https://github.com/eclipxe13/engineworks-dbal/actions/workflows/build.yml?query=branch:main)[![Reliability](https://camo.githubusercontent.com/188238582a599daf0f399dd3486247b6756328faef7f017c60f4e2d70959df89/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d65636c6970786531335f656e67696e65776f726b732d6462616c266d65747269633d72656c696162696c6974795f726174696e67)](https://sonarcloud.io/component_measures?id=eclipxe13_engineworks-dbal&metric=Reliability)[![Maintainability](https://camo.githubusercontent.com/e9442f2469dd41055cbe48d1e88fbe5fb568ebe735617d77ce207d7353ef66a1/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d65636c6970786531335f656e67696e65776f726b732d6462616c266d65747269633d7371616c655f726174696e67)](https://sonarcloud.io/component_measures?id=eclipxe13_engineworks-dbal&metric=Maintainability)[![Code Coverage](https://camo.githubusercontent.com/8ee7147ee8bc3e0b36cf57aeec6898d9b41f608f7fe43bb72e7f10a9d75a71d0/68747470733a2f2f696d672e736869656c64732e696f2f736f6e61722f636f7665726167652f65636c6970786531335f656e67696e65776f726b732d6462616c2f6d61696e3f6c6f676f3d736f6e617271756265636c6f7564267365727665723d6874747073253341253246253246736f6e6172636c6f75642e696f)](https://sonarcloud.io/component_measures?id=eclipxe13_engineworks-dbal&metric=Coverage)[![Violations](https://camo.githubusercontent.com/680585a014e02e01f805c59335c5c541b94e66a00b1c7ce2bbdd2b268993e1a9/68747470733a2f2f696d672e736869656c64732e696f2f736f6e61722f76696f6c6174696f6e732f65636c6970786531335f656e67696e65776f726b732d6462616c2f6d61696e3f666f726d61743d6c6f6e67266c6f676f3d736f6e617271756265636c6f7564267365727665723d6874747073253341253246253246736f6e6172636c6f75642e696f)](https://sonarcloud.io/project/issues?id=eclipxe13_engineworks-dbal&resolved=false)[![Total Downloads](https://camo.githubusercontent.com/0525f8b41d132a7b29b40b65b71c8f75ea24efd7cc112ffb2361aacfc986778f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f65636c697078652f656e67696e65776f726b732d6462616c3f6c6f676f3d7061636b6167697374)](https://packagist.org/packages/eclipxe/engineworks-dbal)

I create this library to abstract the interactions with a relational database. At the time it was created the PDO extension did not exist. If possible try to use PDO instead of this library, mostly because prepared statements.

I'm maintaining this library because I have several applications depending on it, and I had shared this to other people, so they can also maintain their own projects.

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

[](#installation)

To install this library you can use:

```
composer require eclipxe/engineworks-dbal
```

Objects
-------

[](#objects)

### EngineWorks\\DBAL\\DBAL

[](#engineworksdbaldbal)

Main connection object, has several query methods to get the results just as needed. It also contains sql methods to translate SQL Dialects from different drivers.

### EngineWorks\\DBAL\\Recordset

[](#engineworksdbalrecordset)

The Recordset class mimics the main methods of the recordset:

- Open the recordset using an SQL Statement.
- Walk the recordset using the current cursor.
- Access values using the values array, stores original values.
- Use of magic methods Update and Delete.
- Convert from/to database types to common types.

Some drivers do not know how to get the primary keys on a query, in that case you can specify the entity to affect and also the primary keys.

Mysql driver support this feature, it will check for primary keys, auto incrementing fields or unique indexes.

### EngineWorks\\DBAL\\Pager

[](#engineworksdbalpager)

The Pager class uses Recordset to access a limited page of a query, it does not load all the records but only the requested ones

About drivers
-------------

[](#about-drivers)

This library supports Mysqli, Mssql, Sqlsrv and Sqlite3 drivers, you are free to create your own and (please) share it with me.

### Mysqli

[](#mysqli)

- This is the most tested driver on production.

### Sqlsrv

[](#sqlsrv)

- This driver uses Microsoft PHP Driver for SQL Server.
- Result does not know the entity or primary keys of the query. Use overrideEntity and overrideKeys when create a Recordset for update or delete.

### Sqlite3

[](#sqlite3)

- Result does not know the entity or primary keys of the query. Use overrideEntity and overrideKeys when create a Recordset for update or delete.
- When a result is empty (nothing to fetch) it is not possible to know the type of the fields, this make this driver unstable to update using Recordset.
- The method SQLite3Result::fetchArray put the cursor in the first position when called after end of list. This behavior has been corrected on Result and fetch returns always false.

### Mssql

[](#mssql)

- This driver uses PDO dblib, you will need FreeTDS.
- Result does not know the entity or primary keys of the query. Use overrideEntity and overrideKeys when create a Recordset for update or delete.
- The function to quote (PDO::quote) fail with multibyte strings, we are using simple replacements of `'` to `''`
- This driver is not really compatible with PHP 7, use Sqlsrv instead

Compatibility
-------------

[](#compatibility)

This class will be compatible according to [PHP Supported versions](http://php.net/supported-versions.php).

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

[](#contributing)

Contributions are welcome! Please read [CONTRIBUTING](https://github.com/eclipxe13/engineworks-dbal/blob/main/CONTRIBUTING.md) for details and don't forget to take a look in the files [TODO](https://github.com/eclipxe13/engineworks-dbal/blob/main/TODO.md) and [CHANGELOG](https://github.com/eclipxe13/engineworks-dbal/blob/main/CHANGELOG.md).

License
-------

[](#license)

The `eclipxe/engineworks-dbal` library is copyright © [Carlos C Soto](https://eclipxe.com.mx/)and licensed for use under the MIT License (MIT). Please see [LICENSE](https://github.com/eclipxe13/engineworks-dbal/blob/main/LICENSE) for more information.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance73

Regular maintenance activity

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity69

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

Recently: every ~303 days

Total

32

Last Release

152d ago

Major Versions

v1.7.0 → v2.0.02018-07-28

PHP version history (3 changes)v1.2.3PHP &gt;=5.6

v2.0.0PHP &gt;=7.0

v2.3.0PHP &gt;=7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66964609?v=4)[eclipxe](/maintainers/eclipxe)[@Eclipxe](https://github.com/Eclipxe)

---

Top Contributors

[![eclipxe13](https://avatars.githubusercontent.com/u/1266852?v=4)](https://github.com/eclipxe13 "eclipxe13 (509 commits)")

---

Tags

dbalsqlmssqlsqlsrvreadermysqlisqlite3database-abstraction-layerrecordset

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eclipxe-engineworks-dbal/health.svg)

```
[![Health](https://phpackages.com/badges/eclipxe-engineworks-dbal/health.svg)](https://phpackages.com/packages/eclipxe-engineworks-dbal)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[ezsql/ezsql

Advance database access library. Make interacting with a database ridiculously easy. An universal interchangeable CRUD system.

86946.7k](/packages/ezsql-ezsql)[jv2222/ezsql

Advance database access library. Make interacting with a database ridiculously easy. An universal interchangeable CRUD system.

87311.3k2](/packages/jv2222-ezsql)[dibi/dibi

Dibi is Database Abstraction Library for PHP

5013.8M120](/packages/dibi-dibi)[catfan/medoo

The lightweight PHP database framework to accelerate development

4.9k1.5M194](/packages/catfan-medoo)[cycle/database

DBAL, schema introspection, migration and pagination

64690.9k31](/packages/cycle-database)

PHPackages © 2026

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