feat: prepare_stmt support ping (#6924)
* feat: prepare_stmt support ping * feat: prepare_stmt tx support ping
This commit is contained in:
		
							parent
							
								
									26195e6d16
								
							
						
					
					
						commit
						1b48aa072d
					
				| @ -182,6 +182,14 @@ func (db *PreparedStmtDB) QueryRowContext(ctx context.Context, query string, arg | |||||||
| 	return &sql.Row{} | 	return &sql.Row{} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | func (db *PreparedStmtDB) Ping() error { | ||||||
|  | 	conn, err := db.GetDBConn() | ||||||
|  | 	if err != nil { | ||||||
|  | 		return err | ||||||
|  | 	} | ||||||
|  | 	return conn.Ping() | ||||||
|  | } | ||||||
|  | 
 | ||||||
| type PreparedStmtTX struct { | type PreparedStmtTX struct { | ||||||
| 	Tx | 	Tx | ||||||
| 	PreparedStmtDB *PreparedStmtDB | 	PreparedStmtDB *PreparedStmtDB | ||||||
| @ -242,3 +250,11 @@ func (tx *PreparedStmtTX) QueryRowContext(ctx context.Context, query string, arg | |||||||
| 	} | 	} | ||||||
| 	return &sql.Row{} | 	return &sql.Row{} | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | func (tx *PreparedStmtTX) Ping() error { | ||||||
|  | 	conn, err := tx.GetDBConn() | ||||||
|  | 	if err != nil { | ||||||
|  | 		return err | ||||||
|  | 	} | ||||||
|  | 	return conn.Ping() | ||||||
|  | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 hjwblog.com
						hjwblog.com