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:
jason_chuan 2024-01-30 16:48:20 +08:00
parent 853ac2b536
commit cb398e91f6

View File

@ -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