Skip to content

Commit

Permalink
feat: add the rhai-sci collection of functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyconover committed Aug 21, 2024
1 parent 54a2e9f commit ba9bb6e
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 14 deletions.
193 changes: 179 additions & 14 deletions duckdb_evalexpr_rhai_rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions duckdb_evalexpr_rhai_rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ crate-type = ["staticlib"]
rhai = { version = "1.19.0", features = ["serde"] }
rhai-fs = "0.1.3"
rhai-rand = "0.1.6"
rhai-sci = { version = "0.2.1", features = ["nalgebra", "rand"], default-features=false }
rhai-url = "0.0.5"

serde = { version = "1.0.207", features = ["derive"] }
Expand Down
2 changes: 2 additions & 0 deletions duckdb_evalexpr_rhai_rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use rhai::{packages::Package, Dynamic, Engine, Scope, AST};
//use rhai_chrono::ChronoPackage;
use rhai_fs::FilesystemPackage;
use rhai_rand::RandomPackage;
use rhai_sci::SciPackage;
use rhai_url::UrlPackage;

#[repr(C)]
Expand Down Expand Up @@ -65,6 +66,7 @@ pub extern "C" fn compile_ast(
engine.register_global_module(RandomPackage::new().as_shared_module());
engine.register_global_module(FilesystemPackage::new().as_shared_module());
engine.register_global_module(UrlPackage::new().as_shared_module());
engine.register_global_module(SciPackage::new().as_shared_module());
// engine.register_global_module(ChronoPackage::new().as_shared_module());

let ast = engine.compile(expr_str);
Expand Down

0 comments on commit ba9bb6e

Please sign in to comment.