Skip to content

Commit c8fe12b

Browse files
committed
fix: adjusted for gorm.io/driver/postgres v1.5.6
1 parent 6fa202f commit c8fe12b

File tree

3 files changed

+8
-149
lines changed

3 files changed

+8
-149
lines changed

database/dbConnect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func InitDB() *gorm.DB {
124124
address += " port=" + port
125125
}
126126
dsn := address + " user=" + username + " dbname=" + database + " password=" + password + " sslmode=" + sslmode + " TimeZone=" + timeZone
127-
sqlDB, err = sql.Open(driver, dsn)
127+
sqlDB, err = sql.Open("pgx", dsn)
128128
if err != nil {
129129
log.WithError(err).Panic("panic code: 153")
130130
}

go.mod

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
go.mongodb.org/mongo-driver v1.14.0
2525
golang.org/x/crypto v0.19.0
2626
gorm.io/driver/mysql v1.5.4
27-
gorm.io/driver/postgres v1.4.0
27+
gorm.io/driver/postgres v1.5.6
2828
gorm.io/driver/sqlite v1.5.5
2929
gorm.io/gorm v1.25.7
3030
)
@@ -40,20 +40,15 @@ require (
4040
github.com/go-playground/validator/v10 v10.14.1 // indirect
4141
github.com/goccy/go-json v0.10.2 // indirect
4242
github.com/golang/snappy v0.0.4 // indirect
43-
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
44-
github.com/jackc/pgconn v1.13.0 // indirect
45-
github.com/jackc/pgio v1.0.0 // indirect
4643
github.com/jackc/pgpassfile v1.0.0 // indirect
47-
github.com/jackc/pgproto3/v2 v2.3.1 // indirect
4844
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
49-
github.com/jackc/pgtype v1.12.0 // indirect
50-
github.com/jackc/pgx/v4 v4.17.2 // indirect
45+
github.com/jackc/pgx/v5 v5.4.3 // indirect
5146
github.com/jinzhu/inflection v1.0.0 // indirect
5247
github.com/jinzhu/now v1.1.5 // indirect
5348
github.com/json-iterator/go v1.1.12 // indirect
5449
github.com/klauspost/compress v1.16.3 // indirect
5550
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
56-
github.com/kr/pretty v0.3.0 // indirect
51+
github.com/kr/text v0.2.0 // indirect
5752
github.com/leodido/go-urn v1.2.4 // indirect
5853
github.com/lib/pq v1.10.9 // indirect
5954
github.com/mattn/go-isatty v0.0.20 // indirect

0 commit comments

Comments
 (0)