-
Notifications
You must be signed in to change notification settings - Fork 382
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
Generate modular manager code #2970
Conversation
🚀 Deployed on https://deploy-preview-2970--moor.netlify.app |
ReviewThis looks great. I think It would be wise to add tests for modular generated code that has custom row classes too, being that it's really the only part of the code that is kinda brittle. (I wont throw static errors) LGTM Otherwise... Future Changes
items.filter((f)=>f.category.name("Foo")) instead of items.filter((f)=>f.category((f)=>f.name("Foo"))) Adding this would be a bunch of work and wouldn't have to be a breaking change ( Docs NitsWhat do think about removing the extensions from the docs? https://deploy-preview-2970--moor.netlify.app/docs/getting-started/manager/#extensions Why? |
@simolus3 Thanks |
But I'm not doing that :) Essentially I'm partitioning the tables across different manager generators to generate one per file. So if there are two files (
What's the problem with custom row classes and the manager anyway? I think we could at least generate the filter/ordering classes for them since they're only referencing schema columns and not the generated row class, right? It's just inserts and updates that are tricky? But still I imagine that should work with companions.
Anything currently exposed through a public import (and not annotated with an |
Then this PR is great When I ran it with custom row classes, it broke, so I disabled it, I didn't really dig too deeply into it. I'll take a look at it again. I'll hide some internal stuff in the other PR |
Thanks for taking a look! |
When modular code generation is enabled, we now split manager classes into separate files (instead of generating them all at the database).
Closes #2967. cc @dickermoshe let me know if you see anything standing out here. I've replaced the
firstWhere
lookup when resolving a references with just using the table directly. I had to do that because the writer no longer includes all tables for modular builds, do you think that could break anything?