-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
| Requirement | Minimum | Notes |
|---|---|---|
| PHP | 8.0 | 8.0 – 8.4 are tested in CI. |
ext-pdo |
bundled | Always required. |
| Driver ext. | one of the below | Choose based on the database you target. |
| Database | PHP extension | Tested |
|---|---|---|
| MySQL / MariaDB | pdo_mysql |
✓ |
| PostgreSQL | pdo_pgsql |
✓ |
| SQLite | pdo_sqlite |
✓ |
| Anything else PDO knows about | the matching pdo_* extension |
not part of CI, but supported through the generic DSN code path |
The psr/log package is suggested, not required — install it when you
want to pass a real PSR-3 logger as the log credential.
composer require initorm/dbalLock to a specific major to avoid surprises:
composer require initorm/dbal:^2.0The autoload entries are:
{
"psr-4": {
"InitORM\\DBAL\\Connection\\": "src/Connection/",
"InitORM\\DBAL\\DataMapper\\": "src/DataMapper/"
}
}No manual require calls are needed — once Composer's autoloader is
included, every class is discoverable.
<?php
require __DIR__ . '/vendor/autoload.php';
use InitORM\DBAL\Connection\Connection;
$db = new Connection([
'driver' => 'sqlite',
'database' => ':memory:',
'charset' => '',
]);
var_dump($db->query('SELECT 1 AS one')->asAssoc()->row());
// array(1) { ["one"] => int(1) }If the array prints, you are ready to move on to Getting Started.
DBAL itself comes with a PHPUnit suite that you can run after cloning the repository:
git clone https://github.com/InitORM/DBAL.git
cd DBAL
composer install
composer testThe suite finishes in well under a second against SQLite in-memory.
The package ships two GitHub Actions workflows:
-
phpunit.yml— PHP 8.0 / 8.1 / 8.2 / 8.3 / 8.4 matrix; 8.3 also generates an xdebug coverage report and uploads it as an artifact. -
composer-validate.yml— runscomposer validate --stricton every PR that touchescomposer.jsonorcomposer.lock.
If you fork the repo, both workflows pick up automatically.
InitORM DBAL · MIT · maintained by Muhammet ŞAFAK · part of the InitORM stack
Getting Started
Core
Cross-Cutting
Reference
Upgrading
Project