PHPackages                             hatwebtech/dal - 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. hatwebtech/dal

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

hatwebtech/dal
==============

hat dal (database abstraction layer) for PHP 5.3+

0131PHP

Since Oct 19Pushed 11y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

DAL (database abstraction layer) [![PHP 5.3+](https://camo.githubusercontent.com/232ecbf9c02c45058b78a6535ecf758b2b9691e787a7ac219f10cc242aeef291/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d352e332532422d626c75652e737667)](https://camo.githubusercontent.com/232ecbf9c02c45058b78a6535ecf758b2b9691e787a7ac219f10cc242aeef291/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d352e332532422d626c75652e737667)
======================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#dal-database-abstraction-layer-)

[![Latest Unstable Version](https://camo.githubusercontent.com/d77d6c06a5783d019f62e19ff58367b72981efeba4dbbd410107d1bd5c5ef7da/68747470733a2f2f706f7365722e707567782e6f72672f686174776562746563682f64616c2f762f756e737461626c652e737667)](https://packagist.org/packages/hatwebtech/dal) [![License](https://camo.githubusercontent.com/93e8e324f82dc8c0ccc8ba25f524faf8cdf7cbe668c495a63d389370a3d31f38/68747470733a2f2f706f7365722e707567782e6f72672f686174776562746563682f64616c2f6c6963656e73652e737667)](https://packagist.org/packages/hatwebtech/dal)

Description
-----------

[](#description)

**dal** is data abstraction library written in PHP. It's lightweight (half a dozen classes) and fast. It is inspired by Doctrine

```
//example
$q = \hatwebtech\dal\DAL::query()
        ->select('u.id, u.name')
        ->from('User u')
        ->where('u.id =?', 7)
;
```

dal works with PHP 5.3 or later.

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

[](#installation)

The recommended way to install HATwebtech DAL is through Composer. Just create a `composer.json` file and run the `php composer.phar install` command to install it:

```
    {
        "require": {
            "hatwebtech/dal": "dev-master"
        }
    }
```

Information
-----------

[](#information)

### Init

[](#init)

```
$dsn = 'pgsql:dbname=example_db;host=127.0.0.1';

$dbh = new PDO($dsn', 'postgres', 'pass123');

\hatwebtech\dal\DAL::setDbh($dbh);
\hatwebtech\dal\DAL::setTablePath(APPPATH . 'tables/');
\hatwebtech\dal\DAL::setTableNamespace('\\dal_test\\tables\\');
```

### DAL query

[](#dal-query)

coming soon...

### Known Issues

[](#known-issues)

If you discover any bugs, feel free to create an issue on GitHub fork and send us a pull request.

- only Postgres DB is supported for now, MySQL coming soon
- implement groupBy() in Hat Dal Query class.
- implement having() in Hat Dal Query class.
- implement innerJoin() in Hat Dal Query class.
- implement validators (date, string leingth...).
- reduce memory footprint

[Issues List](https://github.com/hatwebtech/dal/issues).

Authors
-------

[](#authors)

- Panajotis Zamos ()

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

[](#contributing)

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

License
-------

[](#license)

Apache 2.0

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d134a0d0936cdf1ba49c2b2e32e0dbdd993383dfaec4f54f6f21bdbbb4ef176d?d=identicon)[panos-zamos](/maintainers/panos-zamos)

---

Top Contributors

[![panos-zamos](https://avatars.githubusercontent.com/u/5365743?v=4)](https://github.com/panos-zamos "panos-zamos (14 commits)")

### Embed Badge

![Health badge](/badges/hatwebtech-dal/health.svg)

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

###  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.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

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

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/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)
