Replies: 1 comment
-
It's true there's likely going to be a separate object for any api you have. These struct tags can be useful for smaller applications that just want to do things quickly. As for reflect based struct mapping you'll have to look outside this project. Personally I've written my own in the past but none are open source atm. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm learning Go and SQLBoiler and I have a pretty naive question about the tags added to the DB model structs. Here's what I'm referring to:
I understand why there's a
boil
tag, but in what circumstances would we wish to marshal this struct and serialize any other way? Even if, say, an API endpoint returns a JSON response that is identical in all respects to the underlying DB table-model, it still seems like a good idea to separate these domains (front-end request/response and back-end table-model) into separate structs.Is there some "reflection-like" API that will programmagically map one struct to another using these tags?
Beta Was this translation helpful? Give feedback.
All reactions