mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:58:11 +00:00
LibSQL: Convert SQL expression evaluation to use ResultOr
Instead of setting an error in the execution context, we can directly return that error or the successful value. This lets all callers, who were already TRY-capable, simply TRY the expression evaluation.
This commit is contained in:
parent
2397836f8e
commit
f3c6cb40d7
4 changed files with 66 additions and 97 deletions
|
@ -47,10 +47,7 @@ ResultOr<ResultSet> Insert::execute(ExecutionContext& context) const
|
|||
row[column_def.name()] = column_def.default_value();
|
||||
}
|
||||
|
||||
auto row_value = row_expr.evaluate(context);
|
||||
if (context.result->is_error())
|
||||
return context.result.release_value();
|
||||
|
||||
auto row_value = TRY(row_expr.evaluate(context));
|
||||
VERIFY(row_value.type() == SQLType::Tuple);
|
||||
auto values = row_value.to_vector().value();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue