Niklas
Niklas
Explore posts from servers
DTDrizzle Team
Created by Niklas on 9/19/2023 in #help
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));
}
});
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...
4 replies