Skip to content

Releases: dymmond/databasez

Version 0.12.0

06 Mar 12:13
e08d4cf

Choose a tag to compare

Fixed

  • Fixed extract_options in SQLAlchemyDatabase popping the wrong key when extracting isolation_level from URL query parameters. The loop variable param retained the value "echo_pool" from the previous iteration, so isolation_level was never actually extracted.
  • Fixed transaction decorator (Transaction.__call__) silently discarding the decorated function's return value. await func(...) is now return await func(...).
  • Fixed force-disconnect cleanup in Database.disconnect() being unreachable dead code. An assert not self._databases_map inside an if self._databases_map: block always fired before the sub-database cleanup loop could execute.
  • Fixed Database._connection property setter returning a value (silently discarded by Python) and having an incorrect -> Connection | None return 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 SQLAlchemyTransaction cleanup 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 dbapi2 and jdbc dialect has_table() probes to avoid malformed identifier quoting.
  • Fixed JDBC reflection index sort-order mapping (get_indexes) using the wrong list element for column_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 of msg.

Changed

  • Narrowed except Exception to except ImportError in TYPE_CHECKING blocks in interfaces.py and core/database.py to avoid masking genuine errors like SyntaxError or AttributeError.
  • Replaced mutable list defaults ["databasez.overwrites"] with immutable tuples ("databasez.overwrites",) in Database.get_backends() and Database.apply_database_url_and_options().
  • Extracted duplicated dialect detection, URL redirection, and AUTOCOMMIT logic in DatabaseTestClient into _resolve_admin_url(), _needs_autocommit(), and _admin_client() helper methods.
  • Tightened type annotations: column: Anycolumn: int | str, template: Anytemplate: str | None.
  • Removed duplicated exception handling block in AsyncWrapper.__getattribute__ (second block was unreachable dead code).
  • Simplified else: raise exc anti-patterns to bare raise in utils.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

13 Feb 13:07
fe54a6d

Choose a tag to compare

Changed

  • Update internal imports to be compatible with SQLAlchemy 1.4+.

Version 0.11.4

10 Feb 16:07
4412c24

Choose a tag to compare

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

06 May 05:42
2ccb05d

Choose a tag to compare

Fixed

  • Excessive and confusing debug logging for overwrite selection.
  • Allow DATABASEZ_POLL_INTERVAL overwrites.

Version 0.11.2

04 Apr 19:27
0.11.2
0d385ba

Choose a tag to compare

Fixed

  • Ruff calls were using different rulesets.
  • Cleaned up database_exist, drop_database, create_database methods of DatabaseTestClient.
  • Remove dependency on sqlalchemy_utils.
  • Provide get_quoter for retrieving a quote method.

Version 0.11.1

08 Jan 07:40
0.11.1
2007586

Choose a tag to compare

Fixed

  • Python 3.9 compatibility.

Version 0.11.0

02 Dec 17:50
0.11.0
9d14ee0

Choose a tag to compare

Added

  • Add support for jdbc reflection.

Version 0.10.2

05 Sep 12:43
fca84df

Choose a tag to compare

Fixed

  • Fix transactions in multi-threading contexts.

Changed

  • The transaction stack contains the backend too.

Removed

  • Remove ACTIVE_TRANSACTIONS ContextVar plus tests for it. It became unreliable with multithreading.

Version 0.10.1

04 Sep 11:30
33929b5

Choose a tag to compare

Added

  • poll_interval parameter (only relevant when using multithreading).

Fixed

  • Improved thread-safety.
  • full_isolation was not passed through in TestClient.

Version 0.10.0

26 Aug 13:39
36dfe9a

Choose a tag to compare

Added

  • full_isolation parameter. Isolate the force_rollback Connection in a thread.
  • Timeouts for operations.

Fixed

  • batched_iterate interface of Connection differed from the one of Database.
  • iterate interface of Connection differed from the one of Database.
  • Hooks were called on automatically created Database objects.
  • More multithreading safety.