Adding timeout to queries
Hi,
We are currently trying out Terpal, and are wondering if there is a way to add timeout to queries?
E.g. kotlinquery supports a queryTimeout when generating sessions.
fun sessionOf(
url: String,
user: String,
password: String,
returnGeneratedKey: Boolean = false,
strict: Boolean = false,
queryTimeout: Int? = null
): Session
This is very useful, as we don't want to use the default database timeout for all our queries.
I have looked around briefly, but couldn't find anything obvious in Terpal so far.
Thanks!
Makes sense to have this configureable on a per-query basis. Let me figure out where to add it.
(P.S. For faster replies, ping me on the Terpal channel on the Kotlin Slack)
I'm interested in this as well...
Have a look at the latest release where you can pass a JdbcExecutionOptions to the runOn functions. This has a sessionTimeout, fetchSize, and queryTimeout. It also has custom prepare-lambdas that it will call on Connection/PreparedStatement/ResultSet if you want even more fine-grained control.