Add PDO adapter + Symfony DBAL-style prepared statement API (fully BC)#4
Draft
Add PDO adapter + Symfony DBAL-style prepared statement API (fully BC)#4
Conversation
…, and improved exception hierarchy Co-authored-by: gabrielsolomon <17990591+gabrielsolomon@users.noreply.github.com>
…e, charset/modes security validation, variable naming Co-authored-by: gabrielsolomon <17990591+gabrielsolomon@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Designing solutions with modern PHP features and clean architecture
Modernize bytic/database towards Symfony DBAL conventions with strict types and security hardening
Feb 28, 2026
…lly backward compatible) Co-authored-by: gabrielsolomon <17990591+gabrielsolomon@users.noreply.github.com>
Copilot
AI
changed the title
Modernize bytic/database towards Symfony DBAL conventions with strict types and security hardening
Add PDO adapter + Symfony DBAL-style prepared statement API (fully BC)
Feb 28, 2026
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.
Moves toward a Symfony DBAL-style query interface backed by PDO and native prepared statements, while keeping the existing MySQLi/interpolated-SQL path entirely intact.
New surface area
PdoAdapter— drop-inAdapterInterfacereplacement using PDO. Also implementsPreparedStatementAdapterInterfaceso parameterised dispatch is automatic.PreparedStatementAdapterInterface— opt-in interface with a single methodexecuteWithParams(string $sql, array $params). MySQLi does not implement it; all existing code is unaffected.Connection::executeQuery()/Connection::executeStatement()— Symfony DBAL-style entry points. Route toexecuteWithParams()when the adapter supports it, otherwise fall back silently toexecute().AbstractQuery::toSql()— returns[string $sql, array $bindings]with?placeholders intact. Scalar, array (IN-list), and nested sub-query bindings are all handled.getString()/assemble()are not changed.ConnectionFactory
Set
driver => pdo_mysqloruse_pdo => truein the connection config to get a PDO-backed connection wired through the existingMySqlConnector(charset, timezone, strict-mode all applied).Usage
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/18ba5ddfec8976260ead6e866180bd5d2f71aa1d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/CarbonPHP/carbon/zipball/f438fcc98f92babee98381d399c65336f3a3827f/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/alcohol/iso3166/zipball/928ac7ecc569db9123a83ef5b1c6efc279e7cb49/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/brick/math/zipball/63422359a44b7f06cae63c3b429b59e8efcc0629/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/bytic/Collections/zipball/d187ad0a5f4731fcc686c2ea97a64fd9e932a57f/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/bytic/cache/zipball/c9ea247b8349e0dfcd54932f1676042064182483/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/bytic/container/zipball/d1c580b989335bf1e934d6d41ef6ae8216b0cf5d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/bytic/inflector/zipball/bdce7bfb611087bb51ffbd1f1cca6dd745ee820d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/bytic/package-base/zipball/07c70b19834ee69fad3b6809cf06fb54c08d72db/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/bytic/profiler/zipball/2957ecb241482a2fa8d0c2336b37adc228c31df0/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/bytic/utility/zipball/20382da5e77f5e8ec31623a4a10c531cb9cdf548/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/ramsey/uuid/zipball/8429c78ca35a09f27565311b98101e2826affde0/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/symfony/cache-contracts/zipball/5d68a57d66910405e5c0b63d6f0af941e66fc868/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/symfony/cache/zipball/e3e76b9ba0dff3dfe08ebda500723976dd9de407/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/symfony/clock/zipball/9169f24776edde469914c1e7a1442a50f7a4e110/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/symfony/dependency-injection/zipball/91e49958b8a6092e48e4711894a1aeb1b151c62a/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/symfony/polyfill-php83/zipball/17f6f9a6b1735c0f163024d959f700cfbc5155e5/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/symfony/service-contracts/zipball/f37b419f7aea2e9abf10abd261832cace12e3300/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/symfony/translation-contracts/zipball/450d4172653f38818657022252f9d81be89ee9a8/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/symfony/translation/zipball/98f26acc99341ca4bab345fb14d7b1d7cb825bed/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/symfony/var-exporter/zipball/03a60f169c79a28513a78c967316fbc8bf17816f/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)https://api.github.com/repos/voku/portable-ascii/zipball/b1d923f88091c6bf09699efcd7c8a1b1bfd7351d/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/904Rf4 /usr/bin/composer install --no-dev --no-interaction --no-progress(http block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.