Skip to content

Commit

Permalink
export Tx
Browse files Browse the repository at this point in the history
  • Loading branch information
sqs committed Oct 19, 2014
1 parent 8375d1c commit 75debbf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
// a call to Commit() or Rollback()
type Transaction struct {
dbmap *DbMap
tx *sqlx.Tx
Tx *sqlx.Tx
}

// Insert has the same behavior as DbMap.Insert(), but runs in a transaction.
Expand Down Expand Up @@ -47,21 +47,21 @@ func (t *Transaction) SelectOne(dest interface{}, query string, args ...interfac
// Exec has the same behavior as DbMap.Exec(), but runs in a transaction.
func (t *Transaction) Exec(query string, args ...interface{}) (sql.Result, error) {
t.dbmap.trace(query, args)
return t.tx.Exec(query, args...)
return t.Tx.Exec(query, args...)
}

// Commit commits the underlying database transaction.
func (t *Transaction) Commit() error {
t.dbmap.trace("commit;")
return t.tx.Commit()
return t.Tx.Commit()
}

// Rollback rolls back the underlying database transaction.
func (t *Transaction) Rollback() error {
t.dbmap.trace("rollback;")
return t.tx.Rollback()
return t.Tx.Rollback()
}

func (t *Transaction) handle() handle {
return &tracingHandle{h: t.tx, d: t.dbmap}
return &tracingHandle{h: t.Tx, d: t.dbmap}
}

0 comments on commit 75debbf

Please sign in to comment.