Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Two custom queries return the same columns #1183

Unanswered
kevinburke1 asked this question in Q&A
Discussion options

If I have two queries that each select the same subset of columns on the same table, sqlc creates two different structs instead of one. Is there a way to get them to return the same struct?

We could potentially do this with type aliases in the same package.

You must be logged in to vote

Replies: 1 comment

Comment options

There is sadly not a way to do this right now. The main issue is that we don't have a syntax for declaring the return type of a query. Thoughts on what that should look like?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #1052 on September 12, 2021 19:40.

AltStyle によって変換されたページ (->オリジナル) /