Conditionally throw error on D1 Batch Process
In Cloudflare D1, we do not have
db.transaction
and instead rely on db.batch
. Cloudflare D1 rolls back if a statement in the batch errors.
It is working ok, but I was wondering if it was possible to throw an error if a select returns zero results. E.g. checking if the user is owner of a certain record before proceeding into other updates
0 Replies