Releases: dymmond/databasez
Releases · dymmond/databasez
Version 0.12.0
Fixed
- Fixed
extract_optionsinSQLAlchemyDatabasepopping the wrong key when extractingisolation_levelfrom URL query parameters. The loop variableparamretained the value"echo_pool"from the previous iteration, soisolation_levelwas never actually extracted. - Fixed transaction decorator (
Transaction.__call__) silently discarding the decorated function's return value.await func(...)is nowreturn await func(...). - Fixed force-disconnect cleanup in
Database.disconnect()being unreachable dead code. Anassert not self._databases_mapinside anif self._databases_map:block always fired before the sub-database cleanup loop could execute. - Fixed
Database._connectionproperty setter returning a value (silently discarded by Python) and having an incorrect-> Connection | Nonereturn annotation. Setters are now correctly-> None. - Fixed refcount underflow in
Database.disconnect()when disconnecting without a prior successful connect, and normalized force-disconnect behavior to reset refcount safely. - Fixed transaction lifecycle edge cases where double commit / rollback could underflow connection counters.
- Fixed out-of-order transaction finalization to raise explicit runtime errors instead of silently continuing.
- Fixed transaction finalization to still clean up connection state when backend commit/rollback raises.
- Fixed
SQLAlchemyTransactioncleanup paths to always clear backend transaction state and restore previous isolation level on failure paths. - Fixed cancellation safety in cross-loop forwarding (
arun_coroutine_threadsafe) so cancelled callers also cancel the submitted future. - Fixed SQL construction in
dbapi2andjdbcdialecthas_table()probes to avoid malformed identifier quoting. - Fixed JDBC reflection index sort-order mapping (
get_indexes) using the wrong list element forcolumn_sorting. - Fixed PostgreSQL overwrite driver auto-upgrade typo (
"pscopg2"->"psycopg2"), restoring expected async driver upgrade behavior. - Fixed ASGI lifespan failure messages to use
message(ASGI-compatible key) instead ofmsg.
Changed
- Narrowed
except Exceptiontoexcept ImportErrorinTYPE_CHECKINGblocks ininterfaces.pyandcore/database.pyto avoid masking genuine errors likeSyntaxErrororAttributeError. - Replaced mutable list defaults
["databasez.overwrites"]with immutable tuples("databasez.overwrites",)inDatabase.get_backends()andDatabase.apply_database_url_and_options(). - Extracted duplicated dialect detection, URL redirection, and AUTOCOMMIT logic in
DatabaseTestClientinto_resolve_admin_url(),_needs_autocommit(), and_admin_client()helper methods. - Tightened type annotations:
column: Any→column: int | str,template: Any→template: str | None. - Removed duplicated exception handling block in
AsyncWrapper.__getattribute__(second block was unreachable dead code). - Simplified
else: raise excanti-patterns to bareraiseinutils.py. - Hardened test-database DDL generation by validating charset/encoding names before interpolation.
- PostgreSQL test-database termination query now binds database name as a parameter instead of interpolating into SQL text.
- Added focused regression coverage for disconnect/refcount handling, transaction finalization safety, cancellation behavior, SQL quoting paths, and overwrite driver upgrades.
Version 0.11.5
Changed
- Update internal imports to be compatible with SQLAlchemy 1.4+.
Version 0.11.4
Changed
- Use monkay.asgi helpers.
- Bump to Python 3.10+.
- Reduce noise by removing info log messages when connecting to/disconnecting from a db.
Version 0.11.3
Fixed
- Excessive and confusing debug logging for overwrite selection.
- Allow
DATABASEZ_POLL_INTERVALoverwrites.
Version 0.11.2
Fixed
- Ruff calls were using different rulesets.
- Cleaned up
database_exist,drop_database,create_databasemethods of DatabaseTestClient. - Remove dependency on sqlalchemy_utils.
- Provide get_quoter for retrieving a quote method.
Version 0.11.1
Fixed
- Python 3.9 compatibility.
Version 0.11.0
Added
- Add support for jdbc reflection.
Version 0.10.2
Fixed
- Fix transactions in multi-threading contexts.
Changed
- The transaction stack contains the backend too.
Removed
- Remove
ACTIVE_TRANSACTIONSContextVar plus tests for it. It became unreliable with multithreading.
Version 0.10.1
Added
poll_intervalparameter (only relevant when using multithreading).
Fixed
- Improved thread-safety.
- full_isolation was not passed through in TestClient.
Version 0.10.0
Added
full_isolationparameter. Isolate the force_rollback Connection in a thread.- Timeouts for operations.
Fixed
batched_iterateinterface ofConnectiondiffered from the one ofDatabase.iterateinterface ofConnectiondiffered from the one ofDatabase.- Hooks were called on automatically created Database objects.
- More multithreading safety.