Feat: Allow Fixing Go Type in queries.sql #3346
Unanswered
mikeschinkel
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I love sqlc, and can't say how much I appreciate the developers for creating it. Thank you.
However, I am starting to run an area where it is causing maintenance problems. Specifically with sqlc changing Go type names when I need to change a single table query into a multiple table query.
Consider if I have a query such as this:
That will cause the
LoadLink()
method to return aLink
type.However, if I later need to add a JOIN to get field from a related table, that changes all related code to
ListFilteredLinksRow
. Now I have to refactor and change all references fromLink
toListFilteredLinksRow
, which can result in a large PR.Is there any appetite to consider adding configuration to allow for more comments as sql-c specific directives to allow developer to specify the type name for a given query inside
query.sql
?or this if you prefer (I like the former, but the latter would work too):
Would the sqlc team be open to a PR of this nature?
BTW, I really would not want this kind of info to be added to
sqlc.yaml
.(Actually, I would prefer to see all DDL and DML-related settings to be in
query.sql
orschema.sql
vs.sqlc.yaml
for locality of behavior, but I digress.)Beta Was this translation helpful? Give feedback.
All reactions