Repository navigation
v0.2.0
🚀 Added
ddsql.connections: the plumbing between aScopedRegistry(ddutils) and the code that runs queries.ConnectionManagerFactory(registries, default, connection_manager_class=ConnectionManager)resolves a connection alias to its registry, like Django'susing, and opens a connection manager on it;registry(using)returns the registry itself.ConnectionManageris 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 overregistry.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()._executereadsself.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
AdapterandSQLBasefailed at class creation withAttributeError: __parameters__: their__init_subclass__did not callsuper().__init_subclass__(), soGenericnever ran. Both now chain tosuper(). - The serializer check runs for concrete adapters only; abstract intermediate adapter classes without
_executeno longer need a placeholderserializer.
Full Changelog: v0.1.0...v0.2.0