Skip to content

Latest commit

 

History

History

get_exchange_rate

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

How to use:

Install WasmEdge and then install the HTTPS plugin as follows.

# Download and extract the plugin
wget "https://github.com/second-state/wasmedge_rustls_plugin/releases/download/0.1.0/WasmEdge-plugin-wasmedge_rustls-0.1.0-alpha-ubuntu20.04_x86_64.tar"

tar -xf "WasmEdge-plugin-wasmedge_rustls-0.1.0-alpha-ubuntu20.04_x86_64.tar"

# Install the plugin if your wasmedge is installed in ~/.wasmedge
cp libwasmedge_rustls.so ~/.wasmedge/plugin/

# Install the plugin if your wasmedge is installed in /usr/local
cp libwasmedge_rustls.so /usr/local/lib/wasmedge/

Make sure that you build libsql with WasmEdge support.

git clone https://github.com/libsql/libsql
cd libsql
./configure --enable-wasm-runtime-wasmedge
make

Build the GET EXCHANGE RATE example.

cargo wasi build --release

Create sql file for libsql and run libsql

./gen_libsql_udf.sh

libsql

Execute in libsql

> .init_wasm_func_table
> .read create_get_exchange_rate_udf.sql
> select get_exchange_rate('USD','CNY');