-
Notifications
You must be signed in to change notification settings - Fork 41
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
Erase domains types wrapper #80
Conversation
Looks good to me! Is this ready to merge? |
I'm not sure if the domain wrapper type should be in the cornucopia client or in the generated code. I'd like to keep it private as it's only used internally, but copying it every time into the codegen seems silly. If you are happy with the current design, you can merge ! |
That is indeed a good question. I think we can make it very clear that cornucopia_client is intended to be consumed by tthe generated code, and not something users should depend on. If there are items in What do you think? |
Another crate may be excessive. How about a |
Our generated domain types do not enforce the domain rules and are only used for ser/deser with the Postgres protocol. By being exposed to the client in parameters and row types, they bring noise without any benefit.
Deserialization
Deserialization is easy, we can simply skip the domain wrapper as it is not needed.
Serialization
We rely on the fact that we generate
FromSql
ourselves to inject the wrapper at the last minute.Depends on #73