SQLITE - Include multiple sql files in 1 transaction
I have a number of sql files containing creates, updates, selects and deletes. I need a shell script that will create a transaction around all these files to ensure that all statements are successfull otherwise I want to rollback.
i.e. if the machine crashes during the update I want to be left in a known state.
I have attempted this below but I get an error: 'unable to open database file'.
sqlite3 mydatabase.db <<ENDOFTEXT
Any help would be really appreciated.