Closed
Description
If I run the following code
query = `
INSERT INTO test_table (id, name, age) VALUES ($1, $2, $3);
UPDATE test_table SET name='Alice' WHERE id=1`;
params = [2, 'Bob', 78];
client.query(query, query_params)
.then(() => {
client.release();
console.log('ok');
}).catch(err => {
client.release();
console.log(err.message);
});
I end up getting the following cannot insert multiple commands into a prepared statement
.
Why is it like this? What are the reasons?
I think it would be really useful to be able to run multiple commands in the same prepared statement, in order to be able to run a single query with many ( N) commands, instead of N different queries with 1 single command.
I'd like to open up a discussion about this, if it has not been discussed before.
Metadata
Metadata
Assignees
Labels
No labels