On the back of #1129 instead of just letting users add single Rust file with the --udf flag, how about we have them give a path to a rust library?
We plan on supporting a Cargo.toml file anyway so that they can add their own dependencies, at that point it might just be beneficial to let them plug-in a library.
The library would be structured like a typical rust library when we do: cargo new sqlplugin --lib.
sqlplugin
--> Cargo.toml
--> src/
------> lib.rs
------> other rust files
lib.rs would expose functions with matching signature as defined in SQL via CREATE FUNCTION.
We could then add this library as a dependency, and call the functions as required.
On the back of #1129 instead of just letting users add single Rust file with the
--udfflag, how about we have them give a path to a rust library?We plan on supporting a
Cargo.tomlfile anyway so that they can add their own dependencies, at that point it might just be beneficial to let them plug-in a library.The library would be structured like a typical rust library when we do:
cargo new sqlplugin --lib.lib.rswould expose functions with matching signature as defined in SQL viaCREATE FUNCTION.We could then add this library as a dependency, and call the functions as required.