mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
Merge 'Add unhex(X)
scalar function' from Lauri Virtanen
This commit adds `unhex(X)` scalar function. Function with `unhex(X,Y)` two arguments is not implemented yet. Relates to issue #144 Closes #353
This commit is contained in:
commit
6fcd818160
5 changed files with 78 additions and 3 deletions
|
@ -77,6 +77,7 @@ pub enum ScalarFunc {
|
|||
SqliteVersion,
|
||||
UnixEpoch,
|
||||
Hex,
|
||||
Unhex,
|
||||
ZeroBlob,
|
||||
}
|
||||
|
||||
|
@ -113,6 +114,7 @@ impl Display for ScalarFunc {
|
|||
ScalarFunc::SqliteVersion => "sqlite_version".to_string(),
|
||||
ScalarFunc::UnixEpoch => "unixepoch".to_string(),
|
||||
ScalarFunc::Hex => "hex".to_string(),
|
||||
ScalarFunc::Unhex => "unhex".to_string(),
|
||||
ScalarFunc::ZeroBlob => "zeroblob".to_string(),
|
||||
};
|
||||
write!(f, "{}", str)
|
||||
|
@ -184,6 +186,7 @@ impl Func {
|
|||
"json" => Ok(Func::Json(JsonFunc::Json)),
|
||||
"unixepoch" => Ok(Func::Scalar(ScalarFunc::UnixEpoch)),
|
||||
"hex" => Ok(Func::Scalar(ScalarFunc::Hex)),
|
||||
"unhex" => Ok(Func::Scalar(ScalarFunc::Unhex)),
|
||||
"zeroblob" => Ok(Func::Scalar(ScalarFunc::ZeroBlob)),
|
||||
_ => Err(()),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue