I have a Nextjs project with Directus and Postgres with PostGIS extension. Currently facing an issue where some requirements require atomic queries in the database flows when Create, Update, Delete triggers in a collection. But I found no way to have transactional flows that allow rollbacks.
There is also an issue where some flow operations have emit enabled (Create, Update) in a for loop setup which trigger a flow but this flow has a Read operation inside that does not return the fully updated data due to action type.
So I thought since Supabase can be connected to the existing Postgres database, I can write database triggers there when an event happens and perform transactions instead of relying on Directus Flows for this case. Given that all the flows are of type action (non-blocking), can Supabase be used for this case? The API used by Nextjs will still be from Directus but Supabase will be used to only manage the transactional queries in database triggers.