-
Notifications
You must be signed in to change notification settings - Fork 44
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
please review r2d2-oracle library #15
Comments
Thanks for letting me know. In the file https://github.com/rursprung/r2d2-oracle/blob/master/src/lib.rs: /// let mut connector = oracle::Connector::new("system", "manager", "");
/// let connector = connector.privilege(oracle::Privilege::Sysdba); Could you remove /// let manager = OracleConnectionManager::new_with_connector(connector.clone()); Could you remove pub fn new_with_connector(connector: oracle::Connector) -> OracleConnectionManager { IMO, rust doesn't tend to use methods starting with fn is_valid(&self, conn: &mut oracle::Connection) -> Result<(), oracle::Error> {
conn.query("SELECT 1 FROM dual", &[]).map(|_| ())
} Could you use fn has_broken(&self, conn: &mut oracle::Connection) -> bool {
self.is_valid(conn).is_err()
} According to this document, I may add a similar method to return the connection status by using OCI_ATTR_SERVER_STATUS after I check what "doing a light weight connection health check" means. |
thanks a lot for your feedback! this doesn't work: let manager = OracleConnectionManager::new_with_connector(oracle::Connector::new("system", "manager", "").privilege(oracle::Privilege::Sysdba));
and this doesn't work either: let connector = oracle::Connector::new("system", "manager", "")
.privilege(oracle::Privilege::Sysdba);
let manager = OracleConnectionManager::new_with_connector(connector.clone());
i think this might actually be a problem of your API design of thanks for the naming suggestion for and thanks for pointing out same goes for |
std::process::Command and std::fs::DirBuilder return I understand the guideline about builders as:
I chose non-consuming builders because |
thanks for your review! |
Hi
i have just published v0.1.0 of the r2d2-oracle library: https://github.com/rursprung/r2d2-oracle
could you please have a look at it and check if it looks good to you?
Thanks!
The text was updated successfully, but these errors were encountered: