efabrica / phoenix-pdo
Shared PDO base (abstract adapter, statement wrapper, factory) for Phoenix database migration adapters
Requires
- php: ^8.4
- ext-pdo: *
- efabrica/phoenix-core: ^4.0
Requires (Dev)
- ext-pdo_sqlite: *
- phpunit/phpunit: ^9.5.11
Suggests
- efabrica/phoenix-mysql: MySQL adapter built on this package
- efabrica/phoenix-pgsql: PostgreSQL adapter built on this package
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-26 08:43:54 UTC
README
Shared PDO base for Phoenix database migration adapters: the abstract Phoenix\Database\Adapter\Pdo\PdoAdapter, PdoStatementWrapper (StatementInterface on top of PDOStatement) and the abstract PdoAdapterFactory.
This package registers no adapter by itself. Install one of the adapters built on it:
- MySQL:
efabrica/phoenix-mysql - PostgreSQL:
efabrica/phoenix-pgsql
composer require efabrica/phoenix-core efabrica/phoenix-mysql
Own PDO based adapter
Extend PdoAdapter (implement the vendor specific parts: query builder, structure loading, escaping) and PdoAdapterFactory (getAdapterName() and createAdapter()), then register the factory via Phoenix\Database\Adapter\AdapterFactory::registerFactory() from a composer autoload.files bootstrap. See efabrica/phoenix-mysql for a complete example.
Tests
Tests run on an in-memory SQLite database (ext-pdo_sqlite), no database server is needed.