// Run implements the logic behind the fake query runner
Run implements the logic behind the fake query runner
// Run implements the logic behind the fake query runner
func (qr *SQLRunner) runCall(query mysql.Query) error {
	qr.lock.Lock()
	defer qr.lock.Unlock()
	defer ginkgo.GinkgoRecover()
	if qr.expectedDSN != nil {
		gomega.Expect(qr.dsn).To(gomega.Equal(*qr.expectedDSN), "DSN does not match")
	}
	if len(qr.expectedCalls) == 0 && qr.allowExtraCalls {
		return nil
	}
	unexpectedMessage := fmt.Sprintf(
		"No expected SQLRunner calls left, but got the following call: (dsn %s, query %s, args %s)",
		qr.dsn, query.String(), query.Args(),
	)
	gomega.Expect(qr.expectedCalls).ToNot(gomega.BeEmpty(), unexpectedMessage)
	call := qr.expectedCalls[0]
	qr.expectedCalls = qr.expectedCalls[1:]
	return call(query.String(), query.Args()...)
}
func ( qr * SQLRunner ) runCall ( query mysql . Query ) error { qr . lock . Lock ( ) defer qr . lock . Unlock ( ) defer ginkgo . GinkgoRecover ( ) if qr . expectedDSN != nil { gomega . Expect ( qr . dsn ) . To ( gomega . Equal ( * qr . expectedDSN ) , " " ) } if len ( qr . expectedCalls ) == 0 && qr . allowExtraCalls { return nil } unexpectedMessage := fmt . Sprintf ( " " , qr . dsn , query . String ( ) , query . Args ( ) , ) gomega . Expect ( qr . expectedCalls ) . ToNot ( gomega . BeEmpty ( ) , unexpectedMessage ) call := qr . expectedCalls [ 0 ] qr . expectedCalls = qr . expectedCalls [ 1 : ] return call ( query . String ( ) , query . Args ( ) ... ) }
Run implements the logic behind the fake query runner
Run implements the logic behind the fake query runner