-
Notifications
You must be signed in to change notification settings - Fork 313
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
Marshaling data into sql.NullString #45
Comments
This isn't really an issue with xo -- you would have this problem no matter the way you chose to generate (or manually wrote) types for your models. Unfortunately, the You could write the It should be noted that directly marshaling a JSON type into a database model is a bad idea for non-trivial applications. |
Thanks for your quick response and suggestions. I've wound up instead adding |
Is there any way to change |
No, not at the moment. I am in the middle of planning for a large (almost total) rewrite of xo, and there has been a lot of requests in general for better ways to specify / override the types that xo generates. As such, in the future I envision there will be significantly better ways to provide these options to xo in the future. At the moment, I would just suggest building your own, modified version locally and using that instead. Changing specific types for a database is relatively easy/straightforward, simply modify the appropriate loader for your database (in the |
Hi. Any suggestions on how to handle marshaling JSON data into structures created by xo?
For example, I have the following table:
xo generates this structure:
I'm trying to marshal this json data (from a POST request I'm making) into a structure:
Using this command:
The problem I'm having its that the Marshal doesn't seem to work with these structures, or throws an error like
I would appreciate any ideas or suggestions!
The text was updated successfully, but these errors were encountered: