I've been begging cloudflare to add a max-spend limit since forever
I've been begging cloudflare to add a max-spend limit since forever
--persist-to option? https://developers.cloudflare.com/d1/wrangler-commands/ and https://developers.cloudflare.com/workers/wrangler/commands/#d1:~:text=Minify%20the%20Worker.-,%2D%2Dpersist%2Dto,-stringwrangler d1 execute in my workers. Or maybe is it a config when I bind the like ENV.DB.execute?wrangler devbatch() but I cannot find any other resources than in this blog post.
This is from the HKG PoP and with a D1 instance in APACAPAC is a huge region and you could be 100-200ms away from your database unfortunately. Having said that anything more than a few hundreds of ms even in those cases is a bigger unexpected issue, either with the responses getting back to your worker or something else.

...
[[d1_databases]]
binding = "FIRESTORM_DB"
database_name = "firestorm-db"
database_id = "c020574a-5623-407b-be0c-cd192bab9545"
migrations_dir = "../d1/migrations"const id = this.env.MY_DURABLE_OBJECT.idFromName(teamId);
const stub = this.env.MY_DURABLE_OBJECT.get(id); const findActivityStartTime = performance.now();
const activity = await prisma.activity.findFirst({
where: {
id: activityId,
goalId: goalId,
goal: {
userId: user.id,
},
},
});
const findActivityEndTime = performance.now();
console.log(
`Time to find activity: ${findActivityEndTime - findActivityStartTime}ms`
);