rkr/php-mysql-query-builder

Easy to use query builder for PHP8.0+/PDO

Maintainers

Package info

github.com/rkrx/php-mysql-query-builder

pkg:composer/rkr/php-mysql-query-builder

Transparency log

Statistics

Installs: 5 772

Dependents: 3

Suggesters: 0

Stars: 23

Open Issues: 0

0.5.6 2026-07-03 15:16 UTC

README

Scrutinizer Code Quality Build Status Latest Stable Version License

Simple mysql query builder to build select, insert, update and delete queries with conditional parts. This library was initially not intended to build prepared statements, but this is also possible. The main motive for this library is an environment where a lot of things are automated.

Here a few things to keep in mind:

  • The charset is up to you. No special binding to UTF8, although UTF8 is the default.
  • You're allowed to nest most queries to build big and powerful queries.
  • The order of method-calls of each statement-builder is irrelevant. The resulting query will always render the right order.

Optional Rust module

An optional Rust-backed PHP extension is available at rkrx/php-rust-mysql-query-builder-module. It provides a native query-builder module that can take over SQL-builder state and rendering while the PHP adapter keeps PDO execution, transactions, logging and fetch helpers compatible with this package.

Some simplified examples

Some extended examples