Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCITransaction hard/impossible to use as pub type. #38

Open
aleshaleksey opened this issue Jun 26, 2020 · 1 comment
Open

OCITransaction hard/impossible to use as pub type. #38

aleshaleksey opened this issue Jun 26, 2020 · 1 comment
Assignees

Comments

@aleshaleksey
Copy link

So trying to use OCITransactionManager when implementing TransactionManager for custom types (namely TransactionManager<diesel_logger::LoggingConnection<OciConnection>> for OciTranactionManager) is either very counter-intuitive, or impossible. So for an ordinary person like myself, impossible. This is in contrast to ANSITransaction in good old diesel, which can be used externally without any problems (see the diesel_logger crate). Thus I believe that this may be an unintentional "over-privatisation" of the OCITransaction type.

The error obtained was typically something like this:

error[E0603]: module `transaction` is private
  --> diesel_logger/src/oracle.rs:18:37
   |
18 | use diesel_oci::oracle::connection::transaction::OCITransactionManager;
   |                                     ^^^^^^^^^^^ private module
   |
note: the module `transaction` is defined here
  --> /root/.cargo/git/checkouts/diesel-oci-f6aa141946064a80/081d02f/src/oracle/connection/mod.rs:28:1
   |
28 | mod transaction;
   | ^^^^^^^^^^^^^^^^

And also applied when use diesel_oci::oracle::connection::OCITransactionManager; was done instead.

The revision it applied to was 081d02fa4012b5b594bbe8c83b7dc46e3ad70b45 although it was found in revisions up to and including ff4b8dc.

Changing mod transaction; to pub mod transaction; in "src/oracle/connection/mod.rs" (though maybe not the most elegant way), did allow the type to be used outside of diesel_oci, so I would suggest that something to this effect be done.

Alternatively, if there is some magical way of using OCITransactionManager that I have overlooked, and it is already a public type, I would like to recommend either simplifying its use or improving the documentation so developers don't have to sweat to hard trying to use it.

@weiznich
Copy link
Member

weiznich commented Jul 4, 2020

Pedantic comment: It is already possible to address this type via <OciConnection as Connection>::TransactionManager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants