adding driverName for postgres ,if not to do so, the stmt vars will be added a wrong one called pgx.QueryExecModeSimpleProtocol , causing the SQL with limit problem need 1 parameter ,but given two.
This commit is contained in:
parent
853ac2b536
commit
cb398e91f6
@ -63,6 +63,7 @@ func OpenTestConnection(cfg *gorm.Config) (db *gorm.DB, err error) {
|
|||||||
db, err = gorm.Open(postgres.New(postgres.Config{
|
db, err = gorm.Open(postgres.New(postgres.Config{
|
||||||
DSN: dbDSN,
|
DSN: dbDSN,
|
||||||
PreferSimpleProtocol: true,
|
PreferSimpleProtocol: true,
|
||||||
|
DriverName: "postgres",
|
||||||
}), cfg)
|
}), cfg)
|
||||||
case "sqlserver":
|
case "sqlserver":
|
||||||
// go install github.com/microsoft/go-sqlcmd/cmd/sqlcmd@latest
|
// go install github.com/microsoft/go-sqlcmd/cmd/sqlcmd@latest
|
||||||
|
Loading…
x
Reference in New Issue
Block a user