Kevin
Kevin
DTDrizzle Team
Created by Kevin on 11/1/2023 in #help
Does throwing an error in a TX automatically rollback?
From what I read in a similar post, it seems that a failed query within a transaction will automatically rollback the entire transaction. I am curious if this applies to any error that causes the transaction to return a rejected promise? For instance, I am using drizzle-valibot to ensure the values inserted within a transaction match the schema. If it doesn't match, can I just throw new Error() causing a rollback for the entire transaction?
2 replies