PHPackages                             elzekool/fluent\_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. elzekool/fluent\_dbal

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

elzekool/fluent\_dbal
=====================

Easy to use and framework independant fluent database abstraction layer on top of PDO.

0.3.2(12y ago)2481MITPHPPHP &gt;=5.3.0

Since Jul 14Pushed 12y agoCompare

[ Source](https://github.com/elzekool/FluentDbal)[ Packagist](https://packagist.org/packages/elzekool/fluent_dbal)[ Docs](https://github.com/elzekool/FluentDbal)[ RSS](/packages/elzekool-fluent-dbal/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)DependenciesVersions (4)Used By (0)

FluentDbal
==========

[](#fluentdbal)

FluentDbal is an easy to use and framework independant fluent database abstraction layer on top of PDO. It helps you to structure database queries easly without creating overhead.

Key features
------------

[](#key-features)

- Allows reusing prepared statements
- Lightweight
- Promotes use of prepared statements, preventing SQL injection hacks

Starting with FluentDbal
------------------------

[](#starting-with-fluentdbal)

1. Make sure PHP 5.3.\* is installed
2. Install FluentDbal using Composer or manually
3. Create a PDO instance
4. Create instance of FluentDbal
5. Use FluentDbal to create queries (sharing PDO connection)

Example
-------

[](#example)

```
$pdo = new \PDO('mysql:host=127.0.0.1;dbname=world', '', '');

$dbal = new FluentDbal($pdo);

$query = $dbal
    ->newQuery()
    ->select('city.Name,country.name, city.District')
    ->from('city')
    ->leftJoin('country', 'country.Code = city.CountryCode')
    ->where('city.CountryCode = ?', 'NLD')

    // Orderby can be repeated
    ->orderby('city.Population','DESC')
    ->orderby('city.Name','ASC')

    ->limit(1);

$city = $query->execute();

print_r($city->fetch());
// stdClass Object
// (
//    [Name] => Amsterdam
//    [name] => Netherlands
//    [District] => Noord-Holland
// )
```

Changelog
---------

[](#changelog)

**11-09-2013**: Allow usage of named parameters while building query For the functions *custom*, *set*, *where* it is now posible to directly add named parameters, to use this add just one parameter of the type array, with the key as parameter name. If you need to set multiple parameters add this in the same array. It is NOT posible to mix numbered and named parameters.

Example: `->where('city.CountryCode = :cc', array(':cc' => 'NLD'))`

License
-------

[](#license)

(MIT License)

Copyright (c) 2013 Elze Kool

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Total

3

Last Release

4590d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/90e8d05eab1cd42d9ae3ab39d812ccc24eb617935e9ce968ec36f9b8da2eedb8?d=identicon)[elzekool](/maintainers/elzekool)

---

Tags

databaselibrarydbalpdofluent

### Embed Badge

![Health badge](/badges/elzekool-fluent-dbal/health.svg)

```
[![Health](https://phpackages.com/badges/elzekool-fluent-dbal/health.svg)](https://phpackages.com/packages/elzekool-fluent-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)[envms/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

925511.7k13](/packages/envms-fluentpdo)[lichtner/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

921274.8k6](/packages/lichtner-fluentpdo)[fpdo/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

921244.9k7](/packages/fpdo-fluentpdo)[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)
