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?