-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion about -go-type #31
Comments
When I handcraft the destination type I can also set the optional fields manually as pointer.
|
I think this implemented in 0056cfb. I still need to test the type override logic but it should work. You can now do: q := NewQuerierConfig(conn, QuerierConfig{DataTypes: []pgtype.DataType{
{
Value: MyTranscoder,
Name: "a_postgres_type",
},
}}) Then you can tweak |
I don't get it. Why this is a runtime option? |
I noticed that the
--pg-type
maps a pg type to a destination go type. The go type have to implement the ValueTranscoder interface, which are quiet a lot functions.Furthermore, a transcoder type cannot be reused.
Often (including pggen itself) has following mechanics:
pg type <-> transcoder type <-> destination go type
note: this is a view of the pgx.ConnInfo state with it's default data set + 2 registerd Composit Types
note: the light green "yes" is the default one - the dark green "yes" is implemented but not the default
What do you think to optionally define separate pgx type / destination types?
The text was updated successfully, but these errors were encountered: