noirapi / database
A strictly typed database abstraction layer over PDO with a query builder and a schema builder (fork of opis/database)
v5.0.0
2026-09-28 11:33 UTC
Requires
- php: ^8.4
- ext-pdo: *
Requires (Dev)
- ext-pdo_sqlite: *
- pdepend/pdepend: 3.x-dev@dev
- phpmd/phpmd: 3.x-dev@dev
- phpstan/phpstan: ^2.1
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^12.0
- rector/rector: ^2.2
- slevomat/coding-standard: ^8.22
- squizlabs/php_codesniffer: ^4.0
- symfony/yaml: ^7.0
- vimeo/psalm: ^7.0.0-beta22
Suggests
- rector/rector: Run rector/set.php to move applications to the 5.0 helpers (bit masks, INET, call())
Provides
None
Conflicts
None
Replaces
This package is auto-updated.
Last update: 2026-09-28 11:33:18 UTC
README
A strictly typed PDO abstraction layer with a fluent query builder and a schema builder, forked from opis/database 4.x.
- PHP 8.4+, native types everywhere,
declare(strict_types=1) - Generic fluent API:
$db->from('users')->where('id')->is(1)->select()->fetchClass(User::class)->first()is typed asUser|falsefor PHPStan and Psalm - Checked with PHPStan (level 10 + strict rules), Psalm (level 1), phpcs (PSR-12 + Slevomat) and PHPMD
- Dialects: MySQL, PostgreSQL, SQLite and Microsoft SQL Server
Upgrading from opis/database? See UPGRADE.md.
Installation
"repositories": [ { "type": "git", "url": "git@github.com:noir-framework/database.git" } ], "require": { "noirapi/database": "^5.0" }
Development
composer check # phpcs, PHPStan, Psalm, PHPMD and PHPUnit composer test # PHPUnit only
License
Apache License, Version 2.0. Original work copyright Zindex Software (see NOTICE).