Skip to content

Commit

Permalink
changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-spacetime committed Jan 30, 2025
1 parent bf4f757 commit 1cd7196
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/core/src/sql/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ pub fn run(
});

// Compute the header for the result set
stmt.iter_return_fields(|col_name, col_type| {
stmt.for_each_return_field(|col_name, col_type| {
head.push((col_name.into(), col_type.clone()));
});

Expand Down
6 changes: 3 additions & 3 deletions crates/expr/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl ProjectName {
}

/// Iterate over the returned column names and types
pub fn iter_return_fields(&self, mut f: impl FnMut(&str, &AlgebraicType)) {
pub fn for_each_return_field(&self, mut f: impl FnMut(&str, &AlgebraicType)) {
if let Some(schema) = self.return_table() {
for schema in schema.columns() {
f(&schema.col_name, &schema.col_type);
Expand Down Expand Up @@ -98,10 +98,10 @@ impl ProjectList {
}

/// Iterate over the projected column names and types
pub fn iter_return_fields(&self, mut f: impl FnMut(&str, &AlgebraicType)) {
pub fn for_each_return_field(&self, mut f: impl FnMut(&str, &AlgebraicType)) {
match self {
Self::Name(project) => {
project.iter_return_fields(f);
project.for_each_return_field(f);
}
Self::List(_, fields) => {
for (name, FieldProject { ty, .. }) in fields {
Expand Down
4 changes: 4 additions & 0 deletions crates/expr/src/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ pub fn type_and_rewrite_show(show: SqlShow, tx: &impl SchemaView) -> TypingResul
// -------------------------------------------
let var_name_field = Expr::Field(FieldProject {
table: ST_VAR_NAME.into(),
// TODO: Avoid hard coding the field position.
// See `StVarFields` for the schema of `st_var`.
field: 0,
ty: AlgebraicType::String,
});
Expand All @@ -333,6 +335,8 @@ pub fn type_and_rewrite_show(show: SqlShow, tx: &impl SchemaView) -> TypingResul
VALUE_COLUMN.into(),
FieldProject {
table: ST_VAR_NAME.into(),
// TODO: Avoid hard coding the field position.
// See `StVarFields` for the schema of `st_var`.
field: 1,
ty: value_col_ty.clone(),
},
Expand Down

0 comments on commit 1cd7196

Please sign in to comment.