diff --git a/lib/src/fnc/script.rs b/lib/src/fnc/script.rs index bb956ee9..4e048a20 100644 --- a/lib/src/fnc/script.rs +++ b/lib/src/fnc/script.rs @@ -105,7 +105,12 @@ impl Class for JsRecord { } } -pub fn run(ctx: &Context, src: &str, arg: Vec, doc: Option<&Value>) -> Result { +pub async fn run( + ctx: &Context<'_>, + src: &str, + arg: Vec, + doc: Option<&Value>, +) -> Result { // Check the context let _ = ctx.check()?; // Create an execution context diff --git a/lib/src/sql/function.rs b/lib/src/sql/function.rs index 23058678..9bb53eb5 100644 --- a/lib/src/sql/function.rs +++ b/lib/src/sql/function.rs @@ -136,7 +136,7 @@ impl Function { for v in x { a.push(v.compute(ctx, opt, txn, doc).await?); } - fnc::script::run(ctx, s, a, doc) + fnc::script::run(ctx, s, a, doc).await } #[cfg(not(feature = "scripting"))] {