-
INITIAL: We have 3 tables referring to each other.
TARGET: We need to pass the nested json to the external API
Solution optionsMETHOD WITH OWN MODEL
METHOD WITH TypeConverters
ANOTHER WAY ABOUT WHICH YOU KNOW |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Type converters apply to individual columns, not to table relationships. If you want to use multiple tables, type converters are probably not the best approach here. I think I'd go into the direction of using an own model for the request. SQL can be a bit tricky when fetching nested data structures, but doing multiple selects isn't expensive with SQLite. |
Beta Was this translation helpful? Give feedback.
Type converters apply to individual columns, not to table relationships. If you want to use multiple tables, type converters are probably not the best approach here. I think I'd go into the direction of using an own model for the request. SQL can be a bit tricky when fetching nested data structures, but doing multiple selects isn't expensive with SQLite.
If you already have model classes for the request, you may be able to integrate them into moor by using custom row classes. But in general the "method with own model" suggestion you made sounds reasonable to me.