Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f4ceee

Browse files
committed
remove sqlx
1 parentc040e8e commit1f4ceee

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
funcNew(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
typesqlQuerierstruct {
52-
sdb*sqlx.DB
51+
sdb*sql.DB
5352
dbDBTX
5453
}
5554

5655
// InTx performs database operations inside a transaction.
5756
func (q*sqlQuerier)InTx(functionfunc(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)

[8]ページ先頭

©2009-2025 Movatter.jp