diff --git a/postgres_gorm/postgres_gorm.go b/postgres_gorm/postgres_gorm.go index 3e69a387..24aa431e 100644 --- a/postgres_gorm/postgres_gorm.go +++ b/postgres_gorm/postgres_gorm.go @@ -384,7 +384,7 @@ loop: } // RawMultipleSQL - выполняет текст запроса, отдельно для каждого запроса -func RawMultipleSQL(db *gorm.DB, TextSQL string) (*gorm.DB, error) { +func RawMultipleSQL(db *gorm.DB, TextSQL string) *gorm.DB { var tx *gorm.DB var err error @@ -410,5 +410,5 @@ func RawMultipleSQL(db *gorm.DB, TextSQL string) (*gorm.DB, error) { log.Panic("db.Raw() error: rows =nil") } - return tx, err + return tx } diff --git a/postgres_gorm/postgres_gorm_test.go b/postgres_gorm/postgres_gorm_test.go index 05663bfa..ba4b6f06 100644 --- a/postgres_gorm/postgres_gorm_test.go +++ b/postgres_gorm/postgres_gorm_test.go @@ -126,7 +126,8 @@ func TestRawMultipleSQL(t *testing.T) { defer CloseConnection() TextSQL := "SELECT 1; SELECT 2" - _, err := RawMultipleSQL(Conn, TextSQL) + tx := RawMultipleSQL(Conn, TextSQL) + err := tx.Error if err != nil { t.Error("TestRawMultipleSQL() error: ", err) }