tursodatabase / libsql-client-go

Go client API for libSQL
MIT License
190 stars 24 forks source link

feat: Add ping ability #97

Closed webstradev closed 9 months ago

webstradev commented 9 months ago

This PR adds a Ping and PingContext method to the Driver which satisfy the sql driver interface.

It uses a simple SELECT 1 to test the connection, which I believe is how most drivers implement a ping.

I have added a test to test the funcitonality and also included an example.

Closes #96

haaawk commented 9 months ago

This adds the Ping only to websockets, no? We have also HTTP transport that needs the support too.

webstradev commented 9 months ago

This adds the Ping only to websockets, no? We have also HTTP transport that needs the support too.

Ah at first glance it didn't look like that had a diver but I guess it needs to be added to the hranaV2Conn I'll amend that now

webstradev commented 9 months ago

@haaawk Should be ready for re-review