10.3.3
- Implemented #692
Method proc had a limited functionality, without supporting procedures with output parameters. The method's signature has been revised, to let you get the output values + optionally transform them.
Example
Say, you have a procedure like this one:
CREATE OR REPLACE PROCEDURE test_proc(INOUT output1 INT, INOUT output2 TEXT)
LANGUAGE plpgsql AS $$
BEGIN
output1 := 123;
output2 := concat(output2, '-hello!');
END;$$;
Then the following calls can be made now:
await db.proc('test_proc', [null, 'world']);
//=> {output1: 123, output2: 'world-hello!'}
await db.proc('test_proc', [null, 'world'], a => a.output2);
//=> 'world-hello!'