Skip to content

Upgrading databases 0.7 to 0.8

Breaking0.7.0 → 0.8.0Breaking4New2Changed5Fixed1

BreakingUpgrade verdict

4 breaking changes.

  • Each concurrent task now gets its own database connection instead of sharing one with the task that started it.
  • A transaction now applies to the connection of the task that called it, not a shared one.
  • Spawning a task gives it a fresh connection unless you hand it one yourself.
  • If you share a transaction between tasks, you must now pass the connection along by hand.
Top 3 of 4 that need code or config changes
Breaking4
Database connections are now task-local and are not inherited by child tasks.
The @db.transaction decorator uses the calling task's connection.
db.transaction
Each new task uses a new connection unless a connection is explicitly provided.
Using an open transaction across tasks now requires explicitly passing the active connection to each task.
db.connection()

Generated by DepDelta from published Python source. Not mixed with prose notes.

  • changed: constructor Connection(backend: DatabaseBackend) -> None → constructor Connection(database: Database, backend: DatabaseBackend) -> None