await db.transaction(async (tx) => { for (let i = 0; i < data.length; i++) { tx.update(cities) .set({ name: data[i].name }) .where(eq(cities.id, data[i].id)); } });