Remove string::contains() SQL function

This commit is contained in:
Tobie Morgan Hitchcock 2022-04-30 21:47:19 +01:00
parent 355f1aac7b
commit d5fab4fbf0
3 changed files with 0 additions and 8 deletions

View file

@ -116,7 +116,6 @@ pub async fn run(ctx: &Runtime, name: &str, args: Vec<Value>) -> Result<Value, E
"rand" => args::check(ctx, name, args, Args::None, rand::rand), "rand" => args::check(ctx, name, args, Args::None, rand::rand),
// //
"string::concat" => args::check(ctx, name, args, Args::Any, string::concat), "string::concat" => args::check(ctx, name, args, Args::Any, string::concat),
"string::contains" => args::check(ctx, name, args, Args::Two, string::contains),
"string::endsWith" => args::check(ctx, name, args, Args::Two, string::ends_with), "string::endsWith" => args::check(ctx, name, args, Args::Two, string::ends_with),
"string::join" => args::check(ctx, name, args, Args::Any, string::join), "string::join" => args::check(ctx, name, args, Args::Any, string::join),
"string::length" => args::check(ctx, name, args, Args::One, string::length), "string::length" => args::check(ctx, name, args, Args::One, string::length),

View file

@ -7,12 +7,6 @@ pub fn concat(_: &Runtime, args: Vec<Value>) -> Result<Value, Error> {
Ok(args.into_iter().map(|x| x.as_strand().value).collect::<Vec<_>>().concat().into()) Ok(args.into_iter().map(|x| x.as_strand().value).collect::<Vec<_>>().concat().into())
} }
pub fn contains(_: &Runtime, mut args: Vec<Value>) -> Result<Value, Error> {
let val = args.remove(0).as_strand().value;
let str = args.remove(0).as_strand().value;
Ok(val.contains(&str).into())
}
pub fn ends_with(_: &Runtime, mut args: Vec<Value>) -> Result<Value, Error> { pub fn ends_with(_: &Runtime, mut args: Vec<Value>) -> Result<Value, Error> {
let val = args.remove(0).as_strand().value; let val = args.remove(0).as_strand().value;
let chr = args.remove(0).as_strand().value; let chr = args.remove(0).as_strand().value;

View file

@ -366,7 +366,6 @@ fn function_rand(i: &str) -> IResult<&str, &str> {
fn function_string(i: &str) -> IResult<&str, &str> { fn function_string(i: &str) -> IResult<&str, &str> {
alt(( alt((
tag("string::concat"), tag("string::concat"),
tag("string::contains"),
tag("string::endsWith"), tag("string::endsWith"),
tag("string::join"), tag("string::join"),
tag("string::length"), tag("string::length"),