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:
Timothy Flynn 2022-02-10 07:46:36 -05:00 committed by Andreas Kling
commit f3c6cb40d7
Notes: sideshowbarker 2024-07-17 19:02:19 +09:00
4 changed files with 66 additions and 97 deletions

View file

@ -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();