Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package jet

import (
"database/sql"
"errors"
)

// Tx represents a transaction instance.
Expand All @@ -21,6 +22,9 @@ func (tx *Tx) Query(query string, args ...interface{}) Runnable {

// Exec calls Exec on the underlying sql.Tx.
func (tx *Tx) Exec(query string, args ...interface{}) (sql.Result, error) {
if tx == nil || tx.tx == nil {
return nil, errors.New("jet: Exec called on nil transaction")
}
return tx.tx.Exec(query, args...)
}

Expand Down