mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 01:58:16 +00:00
Implement like function
This commit is contained in:
parent
7fa8f5c62e
commit
2f738e0c8b
7 changed files with 116 additions and 1 deletions
|
@ -27,8 +27,19 @@ impl AggFunc {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum SingleRowFunc {
|
||||
Coalesce,
|
||||
Like,
|
||||
}
|
||||
|
||||
impl ToString for SingleRowFunc {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
SingleRowFunc::Coalesce => "coalesce".to_string(),
|
||||
SingleRowFunc::Like => "like(2)".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub enum Func {
|
||||
|
@ -50,6 +61,7 @@ impl FromStr for Func {
|
|||
"sum" => Ok(Func::Agg(AggFunc::Sum)),
|
||||
"total" => Ok(Func::Agg(AggFunc::Total)),
|
||||
"coalesce" => Ok(Func::SingleRow(SingleRowFunc::Coalesce)),
|
||||
"like" => Ok(Func::SingleRow(SingleRowFunc::Like)),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue