Expand PDO API coverage - #471
Draft
JanJakes wants to merge 11 commits into
Draft
Conversation
JanJakes
force-pushed
the
pdo-coverage
branch
3 times, most recently
from
August 4, 2026 15:03
ceac9e8 to
89f9344
Compare
Delegate last insert IDs and connection error diagnostics to the active SQLite PDO connection instead of the uninitialized parent PDO state.
Track IDs produced by user INSERT and REPLACE statements so internal information-schema writes cannot alter PDO and legacy driver results.
Initialize the original MySQL query string and expose safe result-oriented PDOStatement operations through the wrapped SQLite statement.
Expose MySQL-compatible metadata through each PDO statement and migrate internal consumers away from mutable driver-wide last-query metadata. Retain the legacy getters as deprecated compatibility APIs.
Preserve native PDO diagnostics and provide MySQL-compatible SQLSTATE, vendor code, and message tuples for emulated errors.
Apply numeric PDO attributes alongside named driver extensions, accept null options, and emulate caller-visible error modes while keeping internal SQLite operations exception-safe.
Override PDO::connect() on PHP 8.4 and newer while loading an empty compatibility trait on older supported runtimes.
Return the standard IM001 PDO diagnostic according to the configured error mode instead of invoking uninitialized parent PDO state.
JanJakes
force-pushed
the
pdo-coverage
branch
2 times, most recently
from
August 4, 2026 18:55
c3cab19 to
01db6d5
Compare
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
Stacked on #469.
This expands PDO compatibility for
WP_MySQL_On_SQLitebefore 3.0 by covering connection diagnostics, constructor options, result statements, column metadata, and PHP 8.4's connection factory. Prepared statements now fail through standard PDO diagnostics until parameter binding can be implemented safely across the full translation pipeline.lastInsertId(),errorCode(), anderrorInfo()without relying on uninitialized parent PDO state.PDOStatement::$queryStringand delegate safe result-statement methods including iteration,closeCursor(),bindColumn(),nextRowset(), diagnostics, anddebugDumpParams().getColumnMeta()with itsarray|falsecontract, and migrate the WordPress and MySQL proxy consumers.get_last_column_count()andget_last_column_meta()compatibility methods.PDOException::$errorInfowith native SQLite or emulated MySQL diagnostics.PDO::connect()on PHP 8.4+ so it creates the emulated connection.prepare()as unsupported with SQLSTATEIM001, respecting the configured PDO error mode instead of triggering an uninitialized-object error.