Dave is working with the music SQLite database, below you can see the database diagram:
Dave is a big fan of the rock band Nirvana and wants to insert records of Nirvana into the music database using transactions.
Your task is to help Dave fill in the blanks in the code to:
Start a transaction
Create the
artistwith name"Nirvana"within the transaction.Handle potential errors by rolling back
Set up GORM's association mode to insert
3records into thesongsandartist_songsjoin table within the transaction.Save the changes to the database if all operations are successful.