Skip to content

Commit

Permalink
feat: expand error message sqlc-dev#1411
Browse files Browse the repository at this point in the history
Tell the uses how to switch off validation here.
  • Loading branch information
akutschera committed Nov 12, 2022
1 parent 0638f37 commit 3d270fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/compiler/output_columns.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func outputColumns(qc *QueryCatalog, node ast.Node, validateOrderBy bool) ([]*Co
}

if err := findColumnForNode(sb.Node, tables, n); err != nil {
return nil, err
return nil, fmt.Errorf("%v: if you want to skip this validation, set 'validate_order_by' to false", err)
}
}
}
Expand All @@ -98,7 +98,7 @@ func outputColumns(qc *QueryCatalog, node ast.Node, validateOrderBy bool) ([]*Co
}

if err := findColumnForNode(caseExpr.Xpr, tables, n); err != nil {
return nil, err
return nil, fmt.Errorf("%v: if you want to skip this validation, set 'validate_order_by' to false", err)
}
}
}
Expand Down

0 comments on commit 3d270fe

Please sign in to comment.