jardissupport / dbquery
Enterprise-Grade SQL Query Builder for PHP 8.2+ - MySQL, PostgreSQL, SQLite
Installs: 120
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/jardissupport/dbquery
Requires
- php: >=8.2
- ext-mbstring: *
- ext-pdo: *
- jardisport/dbquery: ^1.0
- jardissupport/dotenv: ^1.0
Requires (Dev)
- phpstan/phpstan: ^2.0.4
- phpunit/phpunit: ^10.5
- squizlabs/php_codesniffer: ^3.11.2
This package is auto-updated.
Last update: 2026-02-25 17:38:39 UTC
README
Part of the Jardis Ecosystem — A modular DDD framework for PHP
Enterprise-Grade SQL Query Builder for PHP 8.2+. Production-proven, type-safe, and truly database-agnostic. Write once, deploy anywhere: MySQL/MariaDB, PostgreSQL, and SQLite — including advanced features like JSON operations, window functions, and CTEs.
Features
- True Database Independence — Switch between MySQL, PostgreSQL, SQLite without changing code
- Window Functions — ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD with partitioning
- Common Table Expressions — WITH and WITH RECURSIVE for hierarchical queries
- JSON Operations — Database-agnostic JSON querying with automatic dialect translation
- Conflict Handling — ON DUPLICATE KEY (MySQL), ON CONFLICT (PostgreSQL), OR IGNORE (SQLite)
- Security by Design — Prepared statements are standard, not optional
- PHPStan Level 8 — Highest static analysis level, full type safety
Installation
composer require jardissupport/dbquery
Quick Start
use JardisSupport\DbQuery\DbQuery; $query = new DbQuery(); $query->select('id, name, email') ->from('users') ->where('age')->greater(18) ->and('status')->equals('active') ->orderBy('name', 'ASC') ->limit(10); // Generate SQL for any dialect $prepared = $query->sql('mysql', prepared: true); echo $prepared->sql(); // SQL with placeholders print_r($prepared->bindings()); // Values for prepared statement
Documentation
Full documentation, examples and API reference:
→ jardis.io/docs/support/dbquery
Jardis Ecosystem
This package is part of the Jardis Ecosystem — a collection of modular, high-quality PHP packages designed for Domain-Driven Design.
| Category | Packages |
|---|---|
| Core | Kernel, Entity, Workflow |
| Support | DotEnv, Cache, Logger, Messaging, DbConnection, DbQuery, DbSchema, Validation, Factory, ClassVersion |
| Generic | Auth |
| Tools | Builder, Migration, Faker |
License
This package is licensed under the PolyForm Noncommercial License 1.0.0.
For commercial use, see COMMERCIAL.md.