Skip to content

Commit 1f4ceee

Browse files
committed
remove sqlx
1 parent c040e8e commit 1f4ceee

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

coderd/database/db.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff 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 {
3736
func 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

5150
type sqlQuerier struct {
52-
sdb *sqlx.DB
51+
sdb *sql.DB
5352
db DBTX
5453
}
5554

5655
// InTx performs database operations inside a transaction.
5756
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 {
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.

0 commit comments

Comments
 (0)