feat: Add Doctrine DBAL QueryBuilder support#101
Draft
romankonz wants to merge 5 commits into
Draft
Conversation
…eryBuilder() Introduces a thin adapter layer (src/Doctrine/) that bridges the Artemeon Connection to Doctrine DBAL's Driver interface, enabling use of the DBAL QueryBuilder against all three supported databases (MySQL, PostgreSQL, SQLite). - Connection::createQueryBuilder() returns a DBAL QueryBuilder backed by the existing connection (no new physical connection is opened; DBAL instance is cached per Connection object) - DML parameters are passed without HTML-escaping to match the behaviour of the existing fetch methods - MysqlDriver queries SELECT VERSION() once to let DBAL pick the correct platform (MySQL vs MariaDB) instead of hard-coding a version string - Connection::quote() escapes backslashes before single quotes to prevent SQL injection on MySQL with default sql_mode - exec() return type widened to int|string to match the DriverConnection interface contract - fetchFirstColumn() sentinel fix: loops on fetchNumeric() to avoid false-cell truncation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- exec(): narrow return type back to int (covariant narrowing of the interface's int|string is valid; string is never returned in practice) - MysqlDriver: guard fetchOne() result with is_string() before passing as server version string (fetchOne returns mixed) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add doctrine/dbal:^4 to require (was missing; only came in transitively via dev dependencies, causing AbstractSQLiteDriver not found in CI) - Apply Pint style fixes (binary_operator_spaces, whitespace_after_comma, ordered_imports, single_quote) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
romankonz
commented
Jun 24, 2026
| { | ||
| $version = $this->connection->fetchOne('SELECT VERSION()'); | ||
|
|
||
| return new DriverConnectionAdapter($this->connection, is_string($version) ? $version : '8.0.0'); |
romankonz
commented
Jun 24, 2026
|
|
||
| public function connect(#[SensitiveParameter] array $params): DriverConnection | ||
| { | ||
| return new DriverConnectionAdapter($this->connection, '16.0'); |
romankonz
commented
Jun 24, 2026
|
|
||
| public function connect(#[SensitiveParameter] array $params): DriverConnection | ||
| { | ||
| return new DriverConnectionAdapter($this->connection, '3.0.0'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POC(!) der noch nicht poliert ist.