mirror of https://github.com/VinGarcia/ksql.git
Minor improvement on ksql.go
parent
3701f0f325
commit
9792e11b16
6
ksql.go
6
ksql.go
|
@ -64,8 +64,8 @@ type Rows interface {
|
||||||
|
|
||||||
// Tx represents a transaction and is expected to be returned by the DBAdapter.BeginTx function
|
// Tx represents a transaction and is expected to be returned by the DBAdapter.BeginTx function
|
||||||
type Tx interface {
|
type Tx interface {
|
||||||
ExecContext(ctx context.Context, query string, args ...interface{}) (Result, error)
|
DBAdapter
|
||||||
QueryContext(ctx context.Context, query string, args ...interface{}) (Rows, error)
|
|
||||||
Rollback(ctx context.Context) error
|
Rollback(ctx context.Context) error
|
||||||
Commit(ctx context.Context) error
|
Commit(ctx context.Context) error
|
||||||
}
|
}
|
||||||
|
@ -887,7 +887,7 @@ func (c DB) Transaction(ctx context.Context, fn func(Provider) error) error {
|
||||||
return tx.Commit(ctx)
|
return tx.Commit(ctx)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("can't start transaction: The DBAdapter doesn't implement the TxBegginner interface")
|
return fmt.Errorf("can't start transaction: The DBAdapter doesn't implement the TxBeginner interface")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue