GolangWebDev

GolangWebDev

admin Joined on Jun 01, 2022

Recent comments

Hello, This's a Golang web forum!

GolangWebDev
GolangWebDev Jun 01, 2022 02:50 UTC

Bolt allows only one read-write transaction at a time, this site all CRUD are use transaction.

// Start a writable transaction.
tx, err := db.Begin(true)
if err != nil {
    return err
}
defer tx.Rollback()

// Use the transaction...
_, err := tx.CreateBucket([]byte("MyBucket"))
if err != nil {
    return err
}

// Commit the transaction and check for error.
if err := tx.Commit(); err != nil {
    return err
}

Recent posts

Login Topics