driver-go icon indicating copy to clipboard operation
driver-go copied to clipboard

restful conn Ping should verify a connection

Open hcwang512 opened this issue 2 years ago • 2 comments

currently restful conn do nothing in Ping function. Both Open and Ping function will not verify the connection. It breaks the conventional process described in database/sql standard library。 I suggest to verify the connection in Ping function to stay the same with standard library. Below is the comment from database/sql Ping function. // Ping verifies a connection to the database is still alive, // establishing a connection if necessary. // // Ping uses context.Background internally; to specify the context, use // PingContext.

hcwang512 avatar Jul 01 '22 07:07 hcwang512

image

hcwang512 avatar Jul 01 '22 07:07 hcwang512

@hcwang512 Do you have any good advice?

huskar-t avatar Jul 01 '22 08:07 huskar-t