Add zeroblob(N) scalar function

Relates to issue #144
This commit is contained in:
Lauri Virtanen 2024-09-29 23:33:18 +03:00
parent b8dffbf7f9
commit f612ead8a3
No known key found for this signature in database
GPG key ID: 3D41BFC2B70819BA
5 changed files with 79 additions and 4 deletions

View file

@ -77,6 +77,7 @@ pub enum ScalarFunc {
SqliteVersion,
UnixEpoch,
Hex,
ZeroBlob,
}
impl Display for ScalarFunc {
@ -112,6 +113,7 @@ impl Display for ScalarFunc {
ScalarFunc::SqliteVersion => "sqlite_version".to_string(),
ScalarFunc::UnixEpoch => "unixepoch".to_string(),
ScalarFunc::Hex => "hex".to_string(),
ScalarFunc::ZeroBlob => "zeroblob".to_string(),
};
write!(f, "{}", str)
}
@ -182,6 +184,7 @@ impl Func {
"json" => Ok(Func::Json(JsonFunc::Json)),
"unixepoch" => Ok(Func::Scalar(ScalarFunc::UnixEpoch)),
"hex" => Ok(Func::Scalar(ScalarFunc::Hex)),
"zeroblob" => Ok(Func::Scalar(ScalarFunc::ZeroBlob)),
_ => Err(()),
}
}