Skip to content
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

Allow code only mode #60

Open
apstanisic opened this issue Mar 17, 2023 · 1 comment
Open

Allow code only mode #60

apstanisic opened this issue Mar 17, 2023 · 1 comment
Labels
admin-panel Relevant to admin panel api Relevant to API priority-normal Normal priority

Comments

@apstanisic
Copy link
Owner

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

await runServer({
  collections: [myPostCollection],
  managingDb: {
    allowChangingDb: true,
    autoGenerateMissingCollections: true
  }
})
@apstanisic apstanisic added admin-panel Relevant to admin panel api Relevant to API priority-normal Normal priority labels Mar 17, 2023
@apstanisic
Copy link
Owner Author

Defining models

  • type and def separately - must define it twice
  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin-panel Relevant to admin panel api Relevant to API priority-normal Normal priority
Projects
None yet
Development

No branches or pull requests

1 participant