-
Is query timeout supported like JDBC driver? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can time-out a query using Additionally, cancelling an in-flight query might break the connection as we have issues with cancellation still. Postgres and SQLite should be able to handle cancellation okay, but MySQL doesn't (#563). If you're using All that said, I'd recommend setting a timeout on the server side. With Postgres, you can set MySQL provides |
Beta Was this translation helpful? Give feedback.
You can time-out a query using
tokio::time::timeout
orasync_std::future::timeout
but that will only cancel the wait for the query response on the client-side. The server may still be left in a busy state calculating the query results, so the next query on the connection will have to wait for the server to finish the previous one.Additionally, cancelling an in-flight query might break the connection as we have issues with cancellation still. Postgres and SQLite should be able to handle cancellation okay, but MySQL doesn't (#563). If you're using
Pool
it will check if the connection is broken and close it so it doesn't get used again.All that said, I'd recommend setting a timeout on the …