feat(rust/driver_manager): implement connection profiles#3973
feat(rust/driver_manager): implement connection profiles#3973zeroshade wants to merge 22 commits intoapache:mainfrom
Conversation
felipecrv
left a comment
There was a problem hiding this comment.
Not a full review yet. But it's a good start.
rust/driver_manager/src/lib.rs
Outdated
| drv = ManagedDriver::load_from_name( | ||
| driver, | ||
| entrypoint, | ||
| version, | ||
| load_flags, | ||
| additional_search_paths.clone(), | ||
| )?; |
There was a problem hiding this comment.
This can become
DriverLibrary::search(name, load_flags, additional_search_paths)?and you can make every branch return SearchHit. Then at the end you can:
let entrypoint = search_hit.resolve_entrypoint(entrypoint).to_vec();
Self::load_from_library(search_hit.library, entrypoint.as_ref(), version)Then, at the end of all this, you can extract a function that returns SearchHit to search.rs and keep the load_from_library call here. This is what enables different users of search.rs (which I intend to make more public in the upstream too) to instantiate structs that are not ManagedDriver.
There was a problem hiding this comment.
Looks like this is not a trivial change, but you get the intention: move search logic to search.rs and keep only the final instantiation of ManagedDriver in this file.
There was a problem hiding this comment.
that doesn't necessarily work in the case where the profile provides an init_fn though in which case we use load_static rather than using a SearchHit. So i'm not sure how your suggestion would work in that case
|
@felipecrv implemented all the suggestions other than one that I responded to |
Implementing connection profiles for the Rust driver manager including the default FilesystemProfileProvider and updating the objects and tests accordingly.