The MariaDB Node.js connector
Using the batch query function
When using batch queries via conn.batch, be aware that attempting to run a batch with a dataset of exactly one will cause it to fail with a rather unhelpful error message:
SqlError: (conn=229016, no: 1295, SQLState: HY000) This command is not supported in the prepared statement protocol yet
sql: CALL usp_artworks_PublishScheduledArtwork(?) - parameters:[[484]]
at Object.module.exports.createError (/opt/nodejs/node_modules/mariadb/lib/misc/errors.js:57:10)
at PacketNodeEncoded.readError (/opt/nodejs/node_modules/mariadb/lib/io/packet.js:572:19)
Your code needs to check for the case where you only need to perform one query, and use conn.query for that case and conn.batch for cases involving more than one dataset.