Skip to content

[SQL] Support User Defined Functions organized as a Rust Library #1134

@abhizer

Description

@abhizer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SQL compilerRelated to the SQL compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions