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
I would like to have a setting where the above stmt prints SELECT jet.id AS "id" FROM jet; by default.
I know I can manually add aliases to the columns in the query but for porting an older project to Jet it gets tedious quickly.
This answer suggests creating an alias for the table but even defining a table alias with an empty string aliasedTable := Jet.AS("") does not remove the table name from the column alias.
The text was updated successfully, but these errors were encountered:
This #26 (comment) suggests creating an alias for the table but even defining a table alias with an empty string aliasedTable := Jet.AS("") does not remove the table name from the column alias.
Empty alias string means no alias.
I don't see other way then alias each column manually:
Well the problem is not sqlx per se the problem is the hundreds of model structs that are already in the codebase that expect column name aliases without the table name, either due to existing db tag or because of default.
I have an older project where I would like to use Jet as a query generator. The project already contains models with db tags and binding via sqlx.
Jet by default generate queries with column aliases including table names, e.g. for a table called
jet
the codeprints
I would like to have a setting where the above stmt prints
SELECT jet.id AS "id" FROM jet;
by default.I know I can manually add aliases to the columns in the query but for porting an older project to Jet it gets tedious quickly.
This answer suggests creating an alias for the table but even defining a table alias with an empty string
aliasedTable := Jet.AS("")
does not remove the table name from the column alias.The text was updated successfully, but these errors were encountered: