generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Split up DAL + Controller into packages by functionality #1567
Labels
techdebt
Issue is technical debt
Comments
Open
reminder: update package comment on dalerrs.go |
deniseli
added a commit
that referenced
this issue
Jul 8, 2024
…1860) Part 1 of #1567: This PR refactors `cronjobs` dal and sql packages out from the parent controller package. I'm breaking this refactor into many PRs to combat merge conflicts. Ultimate plan for the refactor: * `controller/domain/{dal,sql}` packages hold all the query logic for each domain * When a domain `D` contains certain use cases (i.e. functions) that need to exec queries from a different domain `E`, `D/dal` will call `E/dal`. If those queries spanning multiple domains need to be merged into a single transaction, then `D/dal` will create a wrapper transaction that gets bundled with a `qtx` for each domain that gets queried. `CreateDeployment` is an example of this that should eventually be refactored out of `controller/dal` into `controller/deployment/dal`. * `controller/dal` will cease to exist. * `controller/sql` will not contain any queries. Instead, it will house top-level db artifacts (e.g. `sql/schema`) In the meantime, while this refactor is in progress, `controller/dal` will contain methods that are yet to be pulled out. This PR does not yet generalize the top-level `Tx` logic because `controller/dal` is still the only dal package that uses it.
Whenever we pick this back up, I'd like to split up dal.go just into separate files to start out, before we even begin the package breakdown, just to get things into a slightly more organized state first and prevent excessively-bad merge conflicts. I should have started with that all along - would have helped with anticipating what would/wouldn't work too. |
This was referenced Aug 27, 2024
Open
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
eg. put all lease related queries + DAL into a separate
backend/controller/leases
package along with all of the related logicThe text was updated successfully, but these errors were encountered: