Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 1.2 KB

README.md

File metadata and controls

46 lines (30 loc) · 1.2 KB

seafowl-udf-geo

Example WASM User Defined Function (UDF) for Seafowl in Rust.

For more information on Seafowl WASM support read this blog post.

A blogpost describing the project which uses this code can be found here.

To create your own Seafowl UDFs in Rust, fork this example repository.

Dependencies

First install Rust and Cargo, then install cargo-wasi by running:

cargo install cargo-wasi

Building the WASM module

cargo wasi build --release

Loading the WASM module into Seafowl as a UDF

This repository includes the create_udf.sh shell script which creates the Seafowl function wrapping the Rust WASM logic.

# Start seafowl
SEAFOWL__FRONTEND__HTTP__WRITE_ACCESS=any ./target/release/seafowl

# In another terminal tab/window, run
./create_udf.sh 

Invoking the newly created UDF:

./query_udf.sh

Running unit tests

cargo test