Conversation
…thods (7.0)
Version 7.0 completes the refactoring started in 6.0 and adds the
observability features:
Breaking changes:
- Remove the query methods deprecated since 6.0 (getIterator, getScalar,
getAllFields, execute, executeAndGetId) from DbDriverInterface, the
PDO/OCI8 drivers and DatabaseRouter. DatabaseExecutor is now the
single API for executing queries and commands.
New features:
- Generic event mechanism on DatabaseExecutor
(DatabaseEventObserverInterface, addObserver/removeObserver) firing
BEFORE/AFTER_QUERY and BEFORE/AFTER_EXECUTE events, with no overhead
when no observer is attached.
- Journal package records INSERT, UPDATE and DELETE statements with the
row values before and after each operation:
- JournalRecorder watches all tables or a specific set, with
configurable primary keys
- JournalRestorer replays the journal in reverse to restore the
previous database state (functional test setUp/tearDown)
- Optional strict mode throws JournalException on statements that
cannot be journaled/restored instead of skipping them silently
Infrastructure:
- Pin the SQL Server image to 2022-latest in docker-compose.yml and CI:
the 2025 image (current 'latest') crashes on startup on hybrid CPUs
(Intel P/E-cores) with a topology assert. Rename the compose service
from mssql to sqlserver (matching CI), use MSSQL_SA_PASSWORD instead
of the deprecated SA_PASSWORD, and fix wait-for-db.sh reporting the
database as up when the health check timed out.
Includes tests, documentation (docs/observers.md, docs/journal.md,
removal notes across existing docs) and CHANGELOG-7.0.md.
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
Major release completing the refactoring started in 6.0. See
CHANGELOG-7.0.mdfor the full changelog.Breaking changes
getIterator,getScalar,getAllFields,execute,executeAndGetId) fromDbDriverInterface, the PDO/OCI8 drivers andDatabaseRouter.DatabaseExecutoris now the single API for queries and commands. Docs updated accordingly (docs/deprecated-features.mdis now the migration guide).Executor Observers
DatabaseEventObserverInterface, attachable withDatabaseExecutor::addObserver()/removeObserver()BEFORE_QUERY,AFTER_QUERY,BEFORE_EXECUTE,AFTER_EXECUTE, each carrying aDatabaseEventwith theSqlStatement, the executor and the resultJournal (record and restore DML changes)
JournalRecorder::forAllTables()/::forTables(...)records INSERT/UPDATE/DELETE with row values before and after each operation; configurable primary keysJournalRestorerreplays the journal in reverse — designed for functional test setUp/tearDownJournalExceptionon statements that cannot be journaled/restored (unparseable DML is blocked before execution) instead of skipping silentlyInfrastructure
2022-latest(compose + CI): the 2025 image crashes on startup on hybrid CPUs (Intel P/E-cores) with a topology assert; compose service renamedmssql→sqlserverto match CI;MSSQL_SA_PASSWORD;wait-for-db.shno longer reports success on health-check timeoutTesting
Supersedes #35.