From 7f953319ec16dfa1b18afe863e2839bed207bf48 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Thu, 3 Nov 2022 10:50:51 +0000 Subject: [PATCH] Use consistent singular function naming for SQL time functions --- lib/src/fnc/mod.rs | 4 ++-- lib/src/fnc/time.rs | 4 ++-- lib/src/sql/function.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/src/fnc/mod.rs b/lib/src/fnc/mod.rs index 744732bd..7bef3654 100644 --- a/lib/src/fnc/mod.rs +++ b/lib/src/fnc/mod.rs @@ -184,12 +184,12 @@ pub fn synchronous(ctx: &Context<'_>, name: &str, args: Vec) -> Result time::format, "time::group" => time::group, "time::hour" => time::hour, - "time::mins" => time::mins, + "time::minute" => time::minute, "time::month" => time::month, "time::nano" => time::nano, "time::now" => time::now, "time::round" => time::round, - "time::secs" => time::secs, + "time::second" => time::second, "time::unix" => time::unix, "time::wday" => time::wday, "time::week" => time::week, diff --git a/lib/src/fnc/time.rs b/lib/src/fnc/time.rs index 0618c4c9..99d93c8a 100644 --- a/lib/src/fnc/time.rs +++ b/lib/src/fnc/time.rs @@ -80,7 +80,7 @@ pub fn hour((datetime,): (Option,)) -> Result { Ok(date.hour().into()) } -pub fn mins((datetime,): (Option,)) -> Result { +pub fn minute((datetime,): (Option,)) -> Result { let date = match datetime { Some(Value::Datetime(v)) => v, None => Datetime::default(), @@ -127,7 +127,7 @@ pub fn round((datetime, duration): (Value, Value)) -> Result { }) } -pub fn secs((datetime,): (Option,)) -> Result { +pub fn second((datetime,): (Option,)) -> Result { let date = match datetime { Some(Value::Datetime(v)) => v, None => Datetime::default(), diff --git a/lib/src/sql/function.rs b/lib/src/sql/function.rs index 575f988f..d59f71e4 100644 --- a/lib/src/sql/function.rs +++ b/lib/src/sql/function.rs @@ -422,12 +422,12 @@ fn function_time(i: &str) -> IResult<&str, &str> { tag("time::format"), tag("time::group"), tag("time::hour"), - tag("time::mins"), + tag("time::minute"), tag("time::month"), tag("time::nano"), tag("time::now"), tag("time::round"), - tag("time::secs"), + tag("time::second"), tag("time::unix"), tag("time::wday"), tag("time::week"),