Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 04 Oct 14:27
· 12 commits to main since this release
1a97a15

🚀 Added

  • ddsql.connections: the plumbing between a ScopedRegistry (ddutils) and the code that runs queries. ConnectionManagerFactory(registries, default, connection_manager_class=ConnectionManager) resolves a connection alias to its registry, like Django's using, and opens a connection manager on it; registry(using) returns the registry itself. ConnectionManager is the default manager: it hands out the registry's pooled connection and releases nothing on exit, which is all a ClickHouse client needs. Transactional databases pass their own manager (a unit of work over registry.scope()), because it depends on the driver.
  • Adapter.using(db): the repository picks the database right before executing, SQL(query).postgres.using(PostgresDB.REPLICA).execute(). _execute reads self.db (None = default) and passes it to whatever opens the connection. A fresh adapter is bound on every attribute access, so the choice never leaks between calls.

🐛 Fixed

  • Generic subclasses of Adapter and SQLBase failed at class creation with AttributeError: __parameters__: their __init_subclass__ did not call super().__init_subclass__(), so Generic never ran. Both now chain to super().
  • The serializer check runs for concrete adapters only; abstract intermediate adapter classes without _execute no longer need a placeholder serializer.

Full Changelog: v0.1.0...v0.2.0