Is there a faster way todo this?

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));
         }
      });

This takes about 250ms for me, I find this very slow...
Was this page helpful?