PHPackages                             vitexsoftware/fluentpdo - 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. vitexsoftware/fluentpdo

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

vitexsoftware/fluentpdo
=======================

FluentPDO - PHP 8.1+ Edition. A modernized fork with strict typing, union types, and enhanced features. Quick and light PHP library for rapid query building with smart join builder.

v3.0.3(8mo ago)2297Apache-2.0PHPPHP &gt;=8.1CI failing

Since Jan 27Pushed 1mo agoCompare

[ Source](https://github.com/VitexSoftware/fluentpdo)[ Packagist](https://packagist.org/packages/vitexsoftware/fluentpdo)[ Docs](https://github.com/VitexSoftware/php-vitexsoftware-fluentpdo)[ Patreon](https://www.patreon.com/VitexSoftware)[ RSS](/packages/vitexsoftware-fluentpdo/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (7)Versions (10)Used By (0)

FluentPDO - PHP 8.1+ Edition
============================

[](#fluentpdo---php-81-edition)

**A modernized fork of the original FluentPDO project, updated for PHP 8.1+ with modern type declarations and enhanced features.**

FluentPDO is a PHP SQL query builder using PDO. It's a quick and light library featuring a smart join builder, which automatically creates table joins for you.

About This Fork
---------------

[](#about-this-fork)

This is a modernized fork of the original [envms/fluentpdo](https://github.com/envms/fluentpdo) project. Since the original project has been inactive for 3+ years (last commit in 2021), this fork provides:

- **PHP 8.1+ compatibility** with modern type declarations
- **Strict typing** throughout the codebase
- **Union types** and **mixed types** where appropriate
- **Typed properties** for better IDE support
- **Array parameter handling** with automatic JSON serialization
- **Enhanced error handling** and debugging capabilities
- **Updated dependencies** and development tools

Features
--------

[](#features)

- Easy interface for creating robust queries
- Supports any database compatible with PDO
- Ability to build complex SELECT, INSERT, UPDATE &amp; DELETE queries with little code
- Type hinting for magic methods with code completion in smart IDEs

PHP Version Requirements
------------------------

[](#php-version-requirements)

**This fork requires PHP 8.1 or higher.**

### What's New in This PHP 8.1+ Edition

[](#whats-new-in-this-php-81-edition)

- **Modern Type System**: Full use of PHP 8.1+ type declarations including union types
- **Strict Types**: All files use `declare(strict_types=1)` for better type safety
- **Array Handling**: Automatic JSON serialization of array parameters to prevent SQL errors
- **Enhanced Performance**: Better memory usage and performance through strict typing
- **Developer Experience**: Improved IDE support with proper type hints and autocomplete
- **Future Ready**: Prepared for upcoming PHP versions

### Migrating from Original FluentPDO

[](#migrating-from-original-fluentpdo)

If you're upgrading from the original FluentPDO (v2.x), this version maintains API compatibility while requiring PHP 8.1+. The main changes are internal improvements and type safety enhancements.

Reference
---------

[](#reference)

[Sitepoint - Getting Started with FluentPDO](http://www.sitepoint.com/getting-started-fluentpdo/)

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

[](#installation)

### Composer

[](#composer)

The preferred way to install this PHP 8.1+ edition of FluentPDO is via [composer](http://getcomposer.org/).

```
composer require vitexsoftware/fluentpdo
```

Or add the following line in your `composer.json` file:

```
{
    "require": {
        "vitexsoftware/fluentpdo": "^3.0"
    }
}
```

Then run `composer update` and you're done!

### Requirements

[](#requirements)

- **PHP 8.1+** (required)
- **PDO extension** (required)
- Any PDO-compatible database (MySQL, PostgreSQL, SQLite, etc.)

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

[](#getting-started)

Create a new PDO instance, and pass the instance to FluentPDO:

```
