-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
-
Rust Drivers
The underlying reason for this request has to do with transactions. I have an application where we create the Database handle at startup and then pass that around to the places that need it. This works well for us, as it's a single value which is fully configured for our purpose. The exception is the couple locations where we want to use transactions.
There doesn't appear to be a way to initiate a transaction using only a Database handle; we need a Client. I'm hoping to find a solution that doesn't require we refactor our whole codebase to support passing two separate values.
Database already has a reference to Client. It seems like it would be fine to offer an accessor method:
```
/// Get the Client used by this Database
pub fn client(&self) -> Client
{ self.inner.client.clone() }```