Open awkay opened 4 years ago
Turns out that marking constraints as DEFERRABLE
is standard SQL, and Postgresql supports it. MySQL does not support DEFERRABLE
however.
Surprising. Not sure how some transactions could even work that way...you'd have to loosen your desired constraints in any case where you needed to create a "loop" of data.
set foreign_key_checks=0;
looks like what one would need to do in mysql
would allow multiple SQL databases to safely work together, and if possible would defer FK checks until the end of the transaction (not sure that is std SQL).
Remember that the
env
containsconnection-pools
, which is a map from db name to db. Should be able to usewith-transaction
and replace all of those in that map in env to pass on to next handler.