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.2.5
- kinetis/persistence: ^1.1.1
Requires (Dev)
- infection/infection: ^0.35.0
- phpstan/phpstan: ^2.2.8
- phpunit/phpunit: ^12.5.33
- vimeo/psalm: ^6.16.1
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
kinetis/query-builder
A thin, parameterized SQL query builder for Kinetis
Part of Kinetis, a non-blocking PHP framework for API-first applications, developed in the kinetis-dev/kinetis monorepo.
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+, kinetis/framework,
and kinetis/persistence.
Full documentation:
kinetis.dev/docs/query-builder.html.
License
MIT — see LICENSE.