scalikejdbc / scalikejdbc-async

ScalikeJDBC Extension: Non-blocking APIs in the JDBC way
Apache License 2.0
313 stars 40 forks source link

scalikejdbc-async and r2dbc #368

Open jtjeferreira opened 1 year ago

jtjeferreira commented 1 year ago

Do you have any plans to integrate with r2dbc. The GA version was recently released...

seratch commented 1 year ago

I tried R2DBC a few years ago. My impression back then is that the library is not so Scala-friendly. If it's feasible to configure R2DBC in this project's way, plus it's easy enough to have a bridge between their types and Scala futures, adding something to this project would be great.

With that being said, I no longer write Scala code a lot (sorry about that!). So, I'm still happy to be a reviewer for PRs, but I won't work on the feature addition.

jtjeferreira commented 1 year ago

I never used r2dbc before, but looking at the APIs they use reactivestreams Publisher. I guess those can be transformed to Scala futures using akka or even reactor?

Or maybe jasync-sql will adopt r2dbc and scalikejdbc-async just has to use that (with the downside of having to convert twice r2dbc <-> jasync-sql <-> scalikejdbc-async )?

I will explore the first idea a bit to see how far I can get...

oshai commented 1 year ago

I never used r2dbc before, but looking at the APIs they use reactivestreams Publisher. I guess those can be transformed to Scala futures using akka or even reactor?

Or maybe jasync-sql will adopt r2dbc and scalikejdbc-async just has to use that (with the downside of having to convert twice r2dbc <-> jasync-sql <-> scalikejdbc-async )?

I will explore the first idea a bit to see how far I can get...

jasync-sql is already r2dbc compliant (for mysql), but in the other way around (it is a driver with r2dbc wrapper).
so IIUC with scalike-r2dbc integration you could have many db's which one of them is mysql via jasync-r2dbc module in jasync.