File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import (
1313 "database/sql"
1414 "errors"
1515
16- "github.com/jmoiron/sqlx"
1716 "golang.org/x/xerrors"
1817)
1918
@@ -37,7 +36,7 @@ type DBTX interface {
3736func New (sdb * sql.DB ) Store {
3837 return & sqlQuerier {
3938 db : sdb ,
40- sdb : sqlx . NewDb ( sdb , "postgres" ) ,
39+ sdb : sdb ,
4140 }
4241}
4342
@@ -49,13 +48,13 @@ type querier interface {
4948}
5049
5150type sqlQuerier struct {
52- sdb * sqlx .DB
51+ sdb * sql .DB
5352 db DBTX
5453}
5554
5655// InTx performs database operations inside a transaction.
5756func (q * sqlQuerier ) InTx (function func (Store ) error ) error {
58- if _ , ok := q .db .(* sqlx .Tx ); ok {
57+ if _ , ok := q .db .(* sql .Tx ); ok {
5958 // If the current inner "db" is already a transaction, we just reuse it.
6059 // We do not need to handle commit/rollback as the outer tx will handle
6160 // that.
You can’t perform that action at this time.
0 commit comments