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

Use facades for API and cleanup tech debt #56

Open
6 tasks
WhyAsh5114 opened this issue Dec 3, 2024 · 0 comments
Open
6 tasks

Use facades for API and cleanup tech debt #56

WhyAsh5114 opened this issue Dec 3, 2024 · 0 comments

Comments

@WhyAsh5114
Copy link
Member

WhyAsh5114 commented Dec 3, 2024

For example: create() right now takes Prisma.Args<Delegate, "create">, tx?: TransactionType as parameters, but it should be just Prisma.Args<Delegate, "create">.

We should create a facade to hide this current create(), probably by prefixing it with an _, and have a higher-level API that takes care of transaction creation and makes the tx param required instead of optional.

This will simplify the API, make it more similar to Prisma, and reduce transaction bugs when passing around the tx parameter. However, it will increase the complexity of the client's situation. Maybe something to work on in the future.

Tech debt cleanup:

  • Better _getStoresNeeded() handling
  • An abstract class for all model classes instead of a base class
  • Better _applyRelations() for all clauses
  • Facade API
  • Cleanup repetitive code
  • Use for (const elem of arr) instead of arr.forEach((elem) => {})
@WhyAsh5114 WhyAsh5114 changed the title Use facades for API Use facades for API and cleanup tech debt Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant