use external types #2182
Unanswered
bluebrown
asked this question in
Issue Triage
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am wondering if there is any good way to use sqlc with other codegen tools. For example when using https://github.com/ogen-go/ogen, both sqlc and ogen come with their own type. But chances are that both are pretty much the same. It feels wasteful to map fields from one type to another type, especially for list queries.
If we take the authors example from the docs, the type generated by ogen might look like this
And the type generated by sqlc looks like this
In order to use the data from the sqlc query struct, we need to do something like this
So, It would be nice if both could use the same type somehow.
This is not specific to ogen. It does apply to other codegen tools and maybe even user created types as well.
Beta Was this translation helpful? Give feedback.
All reactions