Me gustaría pasar varias declaraciones en una consulta de una sola línea. ¿Es posible?
const sql = 'update table set column where id = ?; delete from table where id = ? delete from table where id = ? select * from table where id IN (select id from table where id = ?)' await Database.rawQuery(`sql`, [id, id, id, id])Intenté de esta manera pero no funciona. ¿alguna vez me podria ayudar? Gracias
Resolví esta pregunta con la transacción. Como esto.
await Database.transaction(async (trx) => { await trx.from('table').where('id', id).update({column: value}) await trx.from('table').where('id', id).delete() })