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

Ability to check context #22

Open
tatref opened this issue Jan 22, 2020 · 2 comments
Open

Ability to check context #22

tatref opened this issue Jan 22, 2020 · 2 comments

Comments

@tatref
Copy link

tatref commented Jan 22, 2020

Hi,

It we would be great to be able to check if the context initialized successfully (I had issues with LD_LIBRARY_PATH). The problem arise at Connector::connect().unwrap()
Is it possible to check if the context is properly created before attempting a connection?

It seems like the Context struct is private, but I may have missed something.

What do you think about it?

@kubo
Copy link
Owner

kubo commented Jan 26, 2020

Is it possible to check if the context is properly created before attempting a connection?

oracle::Version::client().unwrap() is available.

What do you think about it?

Thought what above code is available, it looks kludge. I may add the following function after I think of a proper function name.

/// Checks whether the Oracle client library was found successfully.
/// It returns `Ok(())` on success. It returns `Err(Error)` to report the error reason on failure.
pub fn fix_method_name() -> Result<()> {
    Context::get().and(Ok(()))
}

@tatref
Copy link
Author

tatref commented Jan 26, 2020

I didn't know about the oracle::Version::client().unwrap() function, thanks for the tip!

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