feat: prepare_stmt tx support ping

This commit is contained in:
philhuan 2024-03-27 10:24:24 +08:00
parent 8299d65d24
commit bed85a4f7f

View File

@ -182,6 +182,14 @@ func (db *PreparedStmtDB) QueryRowContext(ctx context.Context, query string, arg
return &sql.Row{}
}
func (db *PreparedStmtDB) Ping() error {
conn, err := db.GetDBConn()
if err != nil {
return err
}
return conn.Ping()
}
type PreparedStmtTX struct {
Tx
PreparedStmtDB *PreparedStmtDB
@ -243,7 +251,7 @@ func (tx *PreparedStmtTX) QueryRowContext(ctx context.Context, query string, arg
return &sql.Row{}
}
func (tx *PreparedStmtDB) Ping() error {
func (tx *PreparedStmtTX) Ping() error {
conn, err := tx.GetDBConn()
if err != nil {
return err