FIX DB TRANSACTIONS #86

Open
opened 2026-01-31 23:52:24 -07:00 by azpect · 1 comment
Owner

Claude says this is how we should use the transactions

tx, err := r.db.Begin()
if err != nil {
    return err
}
defer tx.Rollback() // Always rollback unless commit succeeds

// ... rest of code ...

if err := tx.Commit(); err != nil {
    return err // Rollback happens automatically via defer
}
return nil
Claude says this is how we should use the transactions ```go tx, err := r.db.Begin() if err != nil { return err } defer tx.Rollback() // Always rollback unless commit succeeds // ... rest of code ... if err := tx.Commit(); err != nil { return err // Rollback happens automatically via defer } return nil ```
azpect added the
Priority
Low
Kind/Infrastructure
labels 2026-01-31 23:52:24 -07:00
Author
Owner

Furthermore, we should use %w for errors instead of %s.

Furthermore, we should use `%w` for errors instead of `%s`.
Sign in to join this conversation.
No description provided.