Closed luc-tielen closed 11 months ago
The transactions are in fact run inside a transaction. For Sqlite the relevant code would is here.
Are you having issues? This is if you run the in the migrate
function. If you run them any other way, you'll need to create the transaction yourself.
I haven't come across an ORM that writes transaction statements in the generated sql migration itself.
Oh, you're right, I'm stupid. When prototyping something I used a quick shell script to apply the SQL, but that is indeed outside of drizzle. Oops!
Describe what you want
Hi,
I've been trying out drizzle together with turso and really liking it so far! But one thing I did seem to miss: there's no transaction blocks in the SQL generated by
drizzlekit generate:sqlite
? This could be nice in case a migration fails halfway through the transaction?For example, this is some SQL it generated for a "address" table:
Could the generator wrap each of the generated .sql files in a transaction block? Also, I only checked with sqlite, but maybe all SQL engines are affected?