mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-12-23 08:21:09 +00:00
remove pattern matching over Name::Quoted
This commit is contained in:
parent
506908e648
commit
2f4d76ec6d
10 changed files with 34 additions and 48 deletions
|
|
@ -98,17 +98,16 @@ pub fn expr_to_value<T: TableContext>(
|
|||
table: &T,
|
||||
) -> Option<SimValue> {
|
||||
match expr {
|
||||
ast::Expr::DoublyQualified(_, _, ast::Name::Ident(col_name))
|
||||
| ast::Expr::DoublyQualified(_, _, ast::Name::Quoted(col_name))
|
||||
| ast::Expr::Qualified(_, ast::Name::Ident(col_name))
|
||||
| ast::Expr::Qualified(_, ast::Name::Quoted(col_name))
|
||||
| ast::Expr::Id(ast::Name::Ident(col_name)) => {
|
||||
ast::Expr::DoublyQualified(_, _, col_name)
|
||||
| ast::Expr::Qualified(_, col_name)
|
||||
| ast::Expr::Id(col_name) => {
|
||||
let columns = table.columns().collect::<Vec<_>>();
|
||||
let col_name = col_name.as_str();
|
||||
assert_eq!(row.len(), columns.len());
|
||||
columns
|
||||
.iter()
|
||||
.zip(row.iter())
|
||||
.find(|(column, _)| column.column.name == *col_name)
|
||||
.find(|(column, _)| column.column.name == col_name)
|
||||
.map(|(_, value)| value)
|
||||
.cloned()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue