https://kotlinlang.org logo
Title
d

Derek Berner

03/04/2019, 8:36 PM
Quick question - is there currently any way to use coroutines with SQL databases when targeting the JVM? Aside from using
<http://Dispatchers.IO|Dispatchers.IO>
, that is. Specifically, our backend is MS SQL Server.
s

sdeleuze

03/04/2019, 9:16 PM
Yes, with https://github.com/spring-projects/spring-data-r2dbc which provides Coroutines API. Not yet GA but we work on it and I think MS SQL server is supported.
👍 2
d

Derek Berner

03/04/2019, 9:18 PM
Awesome! Thanks.
r

Robert Jaros

03/04/2019, 9:48 PM
There is https://github.com/jasync-sql/jasync-sql but not for MS SQL.
d

Derek Berner

03/04/2019, 9:56 PM
Yes, I had seen jasync-sql
s

sitepodmatt

03/05/2019, 12:58 AM
Does r2dbc just use a thread pool for blocking IO behind the scenes? Making withContext(D.IO) { connection.use { } } a better choice for now ?