github.com/dkishere/pop/v6@v6.103.1/db.go (about)

     1  package pop
     2  
     3  import (
     4  	"context"
     5  	"database/sql"
     6  
     7  	"github.com/jmoiron/sqlx"
     8  )
     9  
    10  type dB struct {
    11  	*sqlx.DB
    12  }
    13  
    14  func (db *dB) TransactionContext(ctx context.Context) (*Tx, error) {
    15  	return newTX(ctx, db, nil)
    16  }
    17  
    18  func (db *dB) Transaction() (*Tx, error) {
    19  	return newTX(context.Background(), db, nil)
    20  }
    21  
    22  func (db *dB) TransactionContextOptions(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {
    23  	return newTX(ctx, db, opts)
    24  }
    25  
    26  func (db *dB) Rollback() error {
    27  	return nil
    28  }
    29  
    30  func (db *dB) Commit() error {
    31  	return nil
    32  }