FEAT: Implement the unixepoch function

Signed-off-by: Rajiv Harlalka <rajivharlalka009@gmail.com>
This commit is contained in:
Rajiv Harlalka 2024-08-05 07:17:04 +05:30
parent 1aa7a7c52c
commit 6684fb46e4
4 changed files with 23 additions and 3 deletions

View file

@ -63,6 +63,7 @@ pub enum ScalarFunc {
Time,
Unicode,
Quote,
UnixEpoch,
}
impl ToString for ScalarFunc {
@ -91,6 +92,7 @@ impl ToString for ScalarFunc {
ScalarFunc::Time => "time".to_string(),
ScalarFunc::Unicode => "unicode".to_string(),
ScalarFunc::Quote => "quote".to_string(),
ScalarFunc::UnixEpoch => "unixepoch".to_string(),
}
}
}
@ -137,6 +139,7 @@ impl Func {
"unicode" => Ok(Func::Scalar(ScalarFunc::Unicode)),
"quote" => Ok(Func::Scalar(ScalarFunc::Quote)),
"json" => Ok(Func::Json(JsonFunc::JSON)),
"unixepoch" => Ok(Func::Scalar(ScalarFunc::UnixEpoch)),
_ => Err(()),
}
}