Download the PHP package vitexsoftware/ease-fluentpdo without Composer
On this page you can find all versions of the php package vitexsoftware/ease-fluentpdo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vitexsoftware/ease-fluentpdo
More information about vitexsoftware/ease-fluentpdo
Files in vitexsoftware/ease-fluentpdo
Package ease-fluentpdo
Short Description SQL/PDO support for Ease Framework based on FluentPDO
License MIT
Informations about the package ease-fluentpdo
EaseSQL - FluentPDO Integration
SQL/PDO Support for EasePHP Framework using FluentPDO
Overview
This library provides SQL database support for the EasePHP Framework using FluentPDO for fluent SQL query building. It bridges the gap between Ease Framework's object-oriented approach and modern database operations.
Features
- Multi-database Support: MySQL, PostgreSQL, SQLite, SQL Server
- Fluent Query Builder: Intuitive SQL query construction
- ORM Capabilities: Object-relational mapping with the Ease Framework
- Connection Management: Persistent and non-persistent connections
- Debug Support: SQL query logging and debugging
- Migration Support: Database schema versioning with Phinx
- Logging Integration: Built-in SQL logging capabilities
Key Components
\Ease\SQL\Engine- Main database engine with FluentPDO integration\Ease\SQL\PDO- Enhanced PDO wrapper\Ease\SQL\Orm- Object-relational mapping base class\Ease\SQL\SQL- Abstract SQL operations class\Ease\Logger\LogToSQL- Database logging functionality
Quick Start
Installation
Download https://github.com/VitexSoftware/php-ease-fluentpdo/archive/master.zip or use
Composer
Linux
For Debian, Ubuntu & friends please use repo:
In this case please add this to your app composer.json:
Configuration
Environment Constants
The library uses these environment constants for database configuration:
| Constant | Description | Default | Example |
|---|---|---|---|
DB_TYPE |
Database type | - | mysql, pgsql, sqlite, sqlsrv |
DB_HOST |
Database host | localhost |
127.0.0.1, db.example.com |
DB_PORT |
Database port | - | 3306, 5432 |
DB_DATABASE |
Database name/schema | - | myapp, production_db |
DB_USERNAME |
Database user | - | dbuser, app_user |
DB_PASSWORD |
Database password | - | secret123 |
DB_SETUP |
Setup commands after connect | - | SET NAMES utf8 |
DB_PERSISTENT |
Use persistent connections | 1 |
0 (disable), 1 (enable) |
DB_SETTINGS |
PDO connection settings | - | JSON string of PDO options |
DB_DEBUG |
Enable SQL query logging | false |
true, false |
Configuration Examples
MySQL Configuration
PostgreSQL Configuration
SQLite Configuration
Usage Examples
Basic ORM Operations
FluentPDO Query Builder
Logging to Database
Development & Testing
Prerequisites
- PHP 7.4 or higher
- Composer
- Database server (MySQL, PostgreSQL, SQLite, or SQL Server)
Setup Development Environment
Database Setup for Testing
MySQL
PostgreSQL
Run Migrations
Running Tests
Code Quality
Building & Packaging
Debian Package
Composer Package
API Reference
Core Classes
\Ease\SQL\Engine
Main database engine class providing ORM functionality.
Key Methods:
save()- Insert or update recordload($id)- Load record by IDdelete()- Delete current recordlistingQuery()- Get FluentPDO query buildersetDataValue($key, $value)- Set field valuegetDataValue($key)- Get field value
\Ease\SQL\PDO
Enhanced PDO wrapper with additional functionality.
\Ease\SQL\Orm
Base ORM class for database-backed objects.
\Ease\Logger\LogToSQL
Database logging implementation.
Methods:
addToLog($message, $type, $data)- Add log entrygetLogLevel()- Get current log levelsetLogLevel($level)- Set log level
Migration Support
The library includes support for database migrations using Phinx:
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
make phpunit) - Run code quality checks (
make cs && make static-code-analysis) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Requirements
- PHP: >= 7.4
- Extensions: PDO with appropriate database drivers
- Dependencies:
vitexsoftware/ease-core: >= 1.49.0fpdo/fluentpdo: >= 2.2.4
License
This project is licensed under the MIT License - see the LICENSE file for details.
Links & Resources
- Homepage: https://www.vitexsoftware.cz/ease.php
- GitHub: https://github.com/VitexSoftware/php-ease-fluentpdo
- Packagist: https://packagist.org/packages/vitexsoftware/ease-fluentpdo
- Documentation: https://github.com/VitexSoftware/php-ease-fluentpdo/wiki
- Issue Tracker: https://github.com/VitexSoftware/php-ease-fluentpdo/issues
- EasePHP Core: https://github.com/VitexSoftware/php-ease-core
- FluentPDO: https://github.com/fpdo/fluentpdo
Support
For support and questions:
- Create an issue
- Contact: [email protected]
- Visit: https://www.vitexsoftware.cz