cornucopia icon indicating copy to clipboard operation
cornucopia copied to clipboard

Support for transactions with BEGIN ... END and/or multi-insert statements

Open jvdwrf opened this issue 1 year ago • 0 comments

Currently, it's possible to create transactions with rollback, however these transactions have to communicate multiple times with the database.

It would be great if transactions like the following would be supported:

--! multi_table_insert(param_a, param_b):
BEGIN;

INSERT INTO a (param_a) VALUES (:param_a);
INSERT INTO b (param_b) VALUES (:param_b);

COMMIT;

Additionally, support for statements with multiple INSERTs:

--! some_function(..)
WITH value AS (
    INSERT INTO ... VALUES ... RETURNING ...
) INSERT INTO ... VALUES ...;

jvdwrf avatar May 14 '24 09:05 jvdwrf