refactor: add transaction handling in auto CRUD controller#312
Conversation
|
Looks like you did not link an issue to this PR. If this PR completes a task, consider linking it. |
czaja307
left a comment
There was a problem hiding this comment.
i found one more place that could use transactions - otherwise seems good 🔥
i don't thing we need transactions on seeders or scrappers as they are only used once without much concurrency risc
8f1bfec to
1d46284
Compare
|
We need to discuss
|
|
for isolation levels, i'd suggest to implement transactions in the foreign key validator, i'd suggest passing in the |
Isolations are done |
|
I don't think this validator should exist here, because it only validates the existence of a foreign key. This seems to already be handled by the /**
* Create a related object for 1:1 relations
*
* Return type set to Promise<unknown> to allow for method overrides
*/
async oneToOneRelationStore(httpCtx: HttpContext): Promise<unknown>which handles creating the related object during the store flow. |
|
I'm pretty sure I've made the validators for related-store operations omit the foreign key field on the related object to be created, so it shouldn't matter whether the field has a foreign key validator or not the foreign key validator is actually executed in two scenarios:
(oh and i guess for updates too) |
I think we can close that issue and start another about validator refactor. Should checking fk be only in crud controller for better arch. |
83a7870 to
2369447
Compare
2369447 to
238ab16
Compare
b33f4ab to
1095170
Compare
1095170 to
8cb13c4
Compare
8cb13c4 to
2e4771d
Compare
Add transaction usage in all methods of auto crud controller Add transaction usage in v1/drafts controler Add transaction usage in validators exactly in foreign key validator
2e4771d to
ee0dd09
Compare
#277
Add transaction usage in all methods of auto crud controlle.
There is need to add transactions in 'user managment API'
Should I apply trnsactions in seeders, and scrappers also?