Nested transactions.

This commit is contained in:
Nuno Cruces
2023-02-24 14:31:41 +00:00
parent fcd33d2f0f
commit 0146496036
11 changed files with 458 additions and 39 deletions

View File

@@ -31,7 +31,8 @@ func Example() {
defer db.Close()
defer os.Remove("./recordings.db")
err = createAlbumsTable()
// Create a table with some data in it.
err = albumsSetup()
if err != nil {
log.Fatal(err)
}
@@ -65,7 +66,7 @@ func Example() {
// ID of added album: 5
}
func createAlbumsTable() error {
func albumsSetup() error {
_, err := db.Exec(`
DROP TABLE IF EXISTS album;
CREATE TABLE album (