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
// add a column with a reference to an embedded table
ifembed, ok:=qc.embeds.Find(n); ok {
cols=append(cols, &Column{
Name: embed.Table.Name,
EmbedTable: embed.Table,
})
continue
}
I think it would make sense to keep this information available somehow as now it is impossible to name sqlc.embed when using for example joins or views.
Relevant log output
No response
Database schema
No response
SQL queries
No response
Configuration
No response
Playground URL
No response
What operating system are you using?
No response
What database engines are you using?
No response
What type of code are you generating?
No response
The text was updated successfully, but these errors were encountered:
Small detail, you can use aliases inside the sqlc.embed. So you can do a SELECT sqlc.embed(t) FROM other_table LEFT JOIN some_table AS t ON .... That said, if you have a typo or did not name the embed correctly you immediately get an edited query syntax is invalid: syntax error at or near "," error, this is definitely not the nicest error to throw to an end user.
Version
1.20.0
What happened?
The alias is not used when using
sqlc.embed(name) AS alias
.sqlc/internal/compiler/output_columns.go
Lines 262 to 270 in 8c59fbb
I think it would make sense to keep this information available somehow as now it is impossible to name sqlc.embed when using for example joins or views.
Relevant log output
No response
Database schema
No response
SQL queries
No response
Configuration
No response
Playground URL
No response
What operating system are you using?
No response
What database engines are you using?
No response
What type of code are you generating?
No response
The text was updated successfully, but these errors were encountered: