Best Way To Handle Updates and Deletes To Multiple Tables

I currently have a large number of input components (around 150) spread out across several pages. I need to write the data into a Postgres database where the data is split into about 15 tables and linked together with a unique reference number.

My current solution is to have an update / add new query for each table as well as a delete query for each table. The issue is that if one query throws an error, the rest of that data will still get written causing there to be incomplete data in the DB. Is there a better way to handle this?

Hi @robinyoublind!

I'll gladly assist you with this!

Hm, I'd need a bit more context for your setup! As a first step, would chaining the queries on success of the others via on success event handlers on those queries help? Please let me know!