[Feature Request] Allow access to Client from Database

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Unknown
    • 3.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Rust Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      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() }

      ```

              Assignee:
              Abraham Egnor
              Reporter:
              Dave Grijalva
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: