Use expect to get a better error message if accessing unavailable column

This commit is contained in:
Anton Harniakou
2025-05-28 12:06:15 +03:00
parent 9f45013ec7
commit 74d4726b0c

View File

@@ -789,7 +789,7 @@ impl Statement {
}
pub fn get_column_name(&self, idx: usize) -> Cow<str> {
let column = &self.program.result_columns[idx];
let column = &self.program.result_columns.get(idx).expect("No column");
match column.name(&self.program.table_references) {
Some(name) => Cow::Borrowed(name),
None => Cow::Owned(column.expr.to_string()),