diff --git a/lib/fuzz/fuzz_targets/fuzz_executor.dict b/lib/fuzz/fuzz_targets/fuzz_executor.dict index a128c581..dade6a18 100644 --- a/lib/fuzz/fuzz_targets/fuzz_executor.dict +++ b/lib/fuzz/fuzz_targets/fuzz_executor.dict @@ -168,6 +168,7 @@ "array::push(" "array::remove(" "array::reverse(" +"array::slice(" "array::sort(" "array::sort::asc(" "array::sort::desc(" diff --git a/lib/fuzz/fuzz_targets/fuzz_sql_parser.dict b/lib/fuzz/fuzz_targets/fuzz_sql_parser.dict index 183e5344..daa4892b 100644 --- a/lib/fuzz/fuzz_targets/fuzz_sql_parser.dict +++ b/lib/fuzz/fuzz_targets/fuzz_sql_parser.dict @@ -168,6 +168,7 @@ "array::push(" "array::remove(" "array::reverse(" +"array::slice(" "array::sort(" "array::sort::asc(" "array::sort::desc(" diff --git a/lib/src/fnc/script/modules/surrealdb/functions/array.rs b/lib/src/fnc/script/modules/surrealdb/functions/array.rs index 441110a1..01f88f1d 100644 --- a/lib/src/fnc/script/modules/surrealdb/functions/array.rs +++ b/lib/src/fnc/script/modules/surrealdb/functions/array.rs @@ -28,6 +28,7 @@ impl ModuleDef for Package { module.add("insert")?; module.add("intersect")?; module.add("len")?; + module.add("slice")?; module.add("sort")?; module.add("union")?; Ok(()) @@ -45,6 +46,7 @@ impl ModuleDef for Package { module.set("insert", Func::from(|v: Any| run("array::insert", v.0)))?; module.set("intersect", Func::from(|v: Any| run("array::intersect", v.0)))?; module.set("len", Func::from(|v: Any| run("array::len", v.0)))?; + module.set("slice", Func::from(|v: Any| run("array::slice", v.0)))?; module.set("sort", Func::from(|v: Any| run("array::sort", v.0)))?; module.set("union", Func::from(|v: Any| run("array::union", v.0)))?; // Set default exports @@ -59,6 +61,7 @@ impl ModuleDef for Package { default.set("insert", Func::from(|v: Any| run("array::insert", v.0)))?; default.set("intersect", Func::from(|v: Any| run("array::intersect", v.0)))?; default.set("len", Func::from(|v: Any| run("array::len", v.0)))?; + default.set("slice", Func::from(|v: Any| run("array::slice", v.0)))?; default.set("sort", Func::from(|v: Any| run("array::sort", v.0)))?; default.set("union", Func::from(|v: Any| run("array::union", v.0)))?; module.set("default", default)?;