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
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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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