My database has two tables with bijective row correspondence (as described in this question). It seems this means that to insert a row to each table without violating foreign key constraints requires the two inserts to occur within the same query.
In the Opaleye.Manipulation module I see functions such as runInsertMany
, which insert into a single table. However, these return an IO
action and not a query, and I do not see how to combine them into one. Nowhere in Opaleye do I see how to insert into two tables, or an insert Query
possible of combining with another.
Can Opaleye insert into two different tables within the same query? How?