kinetis / query-builder
A thin, parameterized SQL query builder for Kinetis — MySQL and Postgres via kinetis/persistence's drivers, row-to-DTO mapping via Kinetis\Validation\Hydrator. Not an ORM: no relationships, no migrations, no change-tracking.
Requires
- php: ^8.4
- kinetis/framework: ^1.6
- kinetis/persistence: ^1.7
Requires (Dev)
- infection/infection: ^0.34.2
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^11.0
- vimeo/psalm: ^6.16
README
kinetis/query-builder
A thin, parameterized SQL query builder for Kinetis
MySQL and Postgres via amphp/mysql/amphp/postgres, with row-to-DTO
mapping via Kinetis\Validation\Hydrator — the same mechanism that
hydrates a #[Body] request DTO. Not an ORM: no relationships, no
migrations, no change-tracking, no save()-on-a-model.
use Kinetis\QueryBuilder\Query; $orders = new Query($db) ->table('orders') ->where('customer_id', '=', $customerId) ->where('status', '!=', 'cancelled') ->orderBy('created_at', 'desc') ->limit(20) ->get(OrderRow::class);
Query works with either backend through the same shared Amp\Sql\SqlLink
family both drivers implement, auto-detected from the concrete connection
you pass in — and composes directly inside
Kinetis\Persistence\TransactionGuard::transaction().
Installation
composer require kinetis/query-builder
Requires PHP 8.4+ and kinetis/framework. Full documentation:
docs.kinetis.dev/query-builder.html.
License
MIT — see LICENSE.