You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You're supposed to include the alias in the expr: ModelTableExpr("model_table_expr_name AS table_alias"). Because of this, your code will fail when the alias is present.
You're supposed to include the alias in the expr: ModelTableExpr("model_table_expr_name AS table_alias"). Because of this, your code will fail when the alias is present.
But insert/update don't require to do it. I suppose select would align with other operations.
If this is a must action, it closed the door to use one model for several tables have different table name.
bun@v1.1.17
When ModelTableExpr is called, query select constructs wrong SQL statement.
The result will be
The root cause is
query_select.go:(*SelectQuery).appendColumns
doesn't checkbaseQuery.modelTableName
, uses table alias directly.The following code fixes this bug, for your reference.
The text was updated successfully, but these errors were encountered: