satag / doctrine-firebird-driver
Doctrine DBAL/ORM driver for Firebird SQL 2.5 and newer
Requires
- php: ^8.1
- composer-runtime-api: ^2
- ext-interbase: *
- ext-pdo: *
- doctrine/dbal: ^3.8
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.8
- dg/bypass-finals: ^1.8
- doctrine/coding-standard: 12.0.0
- doctrine/deprecations: ^0.5.3|^1
- doctrine/orm: ^3.0
- fig/log-test: ^1
- jetbrains/phpstorm-stubs: 2024.2
- monolog/monolog: ^3.7
- phpstan/phpstan: 1.12.5
- phpstan/phpstan-doctrine: ^1.5
- phpstan/phpstan-strict-rules: ^1.6
- phpunit/phpunit: 9.6.20
- psalm/plugin-phpunit: 0.19.0
- slevomat/coding-standard: 8.15.0
- squizlabs/php_codesniffer: 3.10.3
- symfony/cache: ^5.4|^6.0|^7.0
- symfony/console: ^4.4|^5.4|^6.0|^7.0
- vimeo/psalm: ^5.0
- 4.0.x-dev
- 3.0.x-dev
- 3.0.1
- 3.0.0
- 2.8.x-dev
- 2.8.1
- 2.8.0
- 2.7.x-dev
- dev-dependabot/github_actions/3.0.x/codecov/codecov-action-5
- dev-dependabot/composer/3.0.x/squizlabs/php_codesniffer-3.11.1
- dev-dependabot/composer/3.0.x/phpstan/phpstan-1.12.7
- dev-dependabot/github_actions/3.0.x/codecov/codecov-action-4
- dev-3.0.2-dev
- dev-dependabot/composer/3.0.x/doctrine/dbal-tw-3.8or-tw-4.0
This package is auto-updated.
Last update: 2024-11-18 22:21:05 UTC
README
Firebird driver for the Doctrine DBAL
Requirements
To utilize this library in your application code, the following is required:
- Firebird Client for Server version 2.5, 3, 4 or 5
- PHP >= 8.1
- fbird/ibase interbase firebird driver
- doctrine/dbal ^3.8
License & Disclaimer
See LICENSE file. Basically: Use this library at your own risk.
Limitations of Schema Manager
This library does not fully support generation through the Schema Manager, i.e.:
- Generation of database tables, views, etc. from entities.
- Generation of entities from database tables, views, etc.
Reasons for not investing time in schema generation include that Firebird does not allow renaming of tables, which in turn makes automated schema updates annoying and over-complicated. Better results are probably achieved by writing manual migrations.
Installation
Via Composer (satag/doctrine-firebird-driver
):
composer install satag/doctrine-firebird-driver
Via Github:
git clone https://github.com/satwareAG/doctrine-firebird-driver.git
Configuration
Manual configuration
Symfony configuration (YAML)
This driver may be used like any other Doctrine DBAL driver in Symfony, e.g. with doctrine/doctrine-bundle. However, the driver_class
option must be specified instead of simply driver
. This is due to the driver not being part of the core Doctrine DBAL library.
Sample YAML configuration:
doctrine:
dbal:
default_connection: default
connections:
default:
driver_class: Satag\DoctrineFirebirdDriver\Driver\Firebird\Driver
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: "UTF-8"
Tests
Test/development requirements
To run tests, fix bugs, provide features, etc. you can use the provided docker compose file in the /tests directory.
Credits
Authors
- Kasper Søfren
https://github.com/kafoso
E-mail: soefritz@gmail.com - Uffe Pedersen
https://github.com/upmedia
Acknowledgements
https://github.com/doctrine/dbal
Fundamental Doctrine DBAL implementation. The driver and platform logic in this library is based on other implementations in the core library, largely \Doctrine\DBAL\Driver\PDOOracle\Driver
and \Doctrine\DBAL\Platforms\OraclePlatform
, and their respective parent classes.
https://github.com/helicon-os/doctrine-dbal
Whilst a great inspiration for this library - and we very much appreciate the work done by the authors - the library has a few flaws and limitations regarding the Interbase Firebird driver logic:
- It contains bugs. E.g. incorrect/insufficient handling of nested transactions and save points.
- It is lacking with respect to test coverage.
- It appears to no longer be maintained. Possibly entirely discontinued.
- It is intermingled with the core Doctrine DBAL code, making version management and code adaptation unnecessarily complicated; a nightmare, really. It is forked from https://github.com/doctrine/dbal, although, this is not specifically stated.
- It is not a Composer package (not on https://packagist.org).
https://github.com/ISTDK/doctrine-dbal
A fork of https://github.com/helicon-os/doctrine-dbal with a few improvements and fixes.
https://firebirdsql.org/
The main resource for Firebird documentation, syntax, downloads, etc.
AI Context-Setting Statement
As an AI specialized in coding, your task is to support me, Michael Wegener, to improve the PHP Doctrine DBAL driver for the Firebird SQL Server for which I am the current maintainer. The Driver is not based on Firebird PDO, it is based on PHP Firebird Extension interbase.so (using fbird_* function aliases for ibase_* functions). You can reference the following resources for guidance:
- satag/doctrine-firebird-driver Source Code Branches
- https://github.com/satwareAG/doctrine-firebird-driver/tree/3.0.x supports DBAL ^3.8
- https://github.com/satwareAG/doctrine-firebird-driver/tree/4.0.x supports DBAL ^4.1
- Doctrine DBAL Driver documentation: Doctrine DBAL
- Reference manuals of Firebird’s implementation of the SQL relational database language for
Firebird 2.5, Firebird 3.0 and Firebird 4.0 - PHP Firebird Extension Source: PHP Firebird extension
- German Firebird Forum
- You can download all given resources for reference.
The PHP Driver is implemented for PHP 8.1+ and should be covered with PHP Unit and Integration Tests against all Firebird Server Versions. Have an eye on modern development principles, performance and security.