You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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) => {})
The text was updated successfully, but these errors were encountered:
WhyAsh5114
changed the title
Use facades for API
Use facades for API and cleanup tech debt
Dec 7, 2024
For example:
create()
right now takesPrisma.Args<Delegate, "create">, tx?: TransactionType
as parameters, but it should be justPrisma.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 thetx
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:
_getStoresNeeded()
handling_applyRelations()
for all clausesfor (const elem of arr)
instead ofarr.forEach((elem) => {})
The text was updated successfully, but these errors were encountered: