Creating schema with GUI complicates migration a lot, it's harder to create data without autocomplete.
Using GUI is only easier for non developers, but usually non developers should not touch database.
Since Zmaj already has support for migrations, only thing to enable code models is to allow users to pass collections directly.
Then I can even allow functions to be attached to them, since they don't have to be a valid json anymore.
It should be more like Laravel Nova.
Summarized:
Allow user to pass CollectionDef, and provide settings to enable/disable managing db, and settings should we generate missing collections.
classes - does not provide field level type safety, must use decorators, complicates since it's class (can I use instanceof, or not, when returning sub-type, lying about it)
builder - can't have recursive type. Only if fields are separated. So it has to have 3 steps: fields -> type (fields + rel) -> def collection
Creating schema with GUI complicates migration a lot, it's harder to create data without autocomplete.
Using GUI is only easier for non developers, but usually non developers should not touch database. Since Zmaj already has support for migrations, only thing to enable code models is to allow users to pass collections directly. Then I can even allow functions to be attached to them, since they don't have to be a valid json anymore. It should be more like Laravel Nova.
Summarized: Allow user to pass
CollectionDef
, and provide settings to enable/disable managing db, and settings should we generate missing collections.Something like