Replies: 1 comment 1 reply
-
Very interesting ideas! I've always liked the idea of writing plugins for other builders. I think the easiest approach would be for moor_generator to generate some kind of JSON structure that other generators could take as input. We have some existing support for this already, it shouldn't be much work to emit that for each database class. Adding a build option to stop generating companions and data classes sounds great! We can also add some apis into the
Note that companions are also used to hold partial data, e.g. for inserts where some columns have default values. |
Beta Was this translation helpful? Give feedback.
-
I'm interested in making a custom data class generator, but would like to avoid forking. My current thinking is to PR:
fromData, toColumns, from/toJson
This would enable me and others to author 3rd party generators, without doing something cloogy like binding to the moor output, or forking and forgetting (i.e. #114)
For more info on my generator, I'm interested in:
freezed
, which would make companion classes unnecessary due to nullable copyWith along with other DX benefits@OneToMany
method generatorAs extends Bs
results inA implements B
with anabstract class B
if necessary)Beta Was this translation helpful? Give feedback.
All reactions