File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import (
13
13
"database/sql"
14
14
"errors"
15
15
16
- "github.com/jmoiron/sqlx"
17
16
"golang.org/x/xerrors"
18
17
)
19
18
@@ -37,7 +36,7 @@ type DBTX interface {
37
36
func New (sdb * sql.DB ) Store {
38
37
return & sqlQuerier {
39
38
db : sdb ,
40
- sdb : sqlx . NewDb ( sdb , "postgres" ) ,
39
+ sdb : sdb ,
41
40
}
42
41
}
43
42
@@ -49,13 +48,13 @@ type querier interface {
49
48
}
50
49
51
50
type sqlQuerier struct {
52
- sdb * sqlx .DB
51
+ sdb * sql .DB
53
52
db DBTX
54
53
}
55
54
56
55
// InTx performs database operations inside a transaction.
57
56
func (q * sqlQuerier ) InTx (function func (Store ) error ) error {
58
- if _ , ok := q .db .(* sqlx .Tx ); ok {
57
+ if _ , ok := q .db .(* sql .Tx ); ok {
59
58
// If the current inner "db" is already a transaction, we just reuse it.
60
59
// We do not need to handle commit/rollback as the outer tx will handle
61
60
// that.
You can’t perform that action at this time.
0 commit comments