slick icon indicating copy to clipboard operation
slick copied to clipboard

cats.IO supports

Open softshipper opened this issue 4 years ago • 13 comments

Hi Slick team I have a question regarding to https://github.com/typelevel/cats-effect support. Do you plan in the future to support Cats.IO?

Thanks

softshipper avatar Aug 15 '20 14:08 softshipper

Hi @softshipper!

Slick is currently being maintained by its users who fix bugs and develop features that they need or want. As such, we don't have a roadmap or plans. If you want to start working on Cats.IO support, I'm sure you will find support for your efforts and even other developers who can help.

hvesalai avatar Aug 17 '20 07:08 hvesalai

There are plenty of companion libraries that can be used to integrate Slick (Scala Futures based) with other effect systems like Cats-Effects and Zio. Examples include:

  • https://github.com/kubukoz/slick-effect
  • https://github.com/RMSone/slick-cats
  • https://github.com/ScalaConsultants/zio-slick-interop

pjfanning avatar Sep 07 '22 10:09 pjfanning

https://github.com/RMSone/slick-cats is forked under the slick organization.

Does anyone know who owns it though?

nafg avatar Sep 16 '22 01:09 nafg

But it's not for cats IO. For cats IO use kubukoz/slick-effect

nafg avatar Sep 16 '22 01:09 nafg

I would say the correct way to go would be to rip Futures away from Slick. I did analyze the thing a few years back and it wouldn't be such a big change.

hvesalai avatar Sep 16 '22 07:09 hvesalai

👋

That would be great, and is one of the things we can look into after Scala 3 support ships.

But what does your vision look like exactly?

nafg avatar Sep 16 '22 10:09 nafg

I don't have a vision other than a complete rewrite of https://github.com/slick/slick/blob/main/slick/src/main/scala/slick/basic/BasicBackend.scala

Basically Slick needs asynchronous processing for three tings:

  • waiting for a connection from a connection pool
  • executing the query asynchronously
  • mixing in user provided asynchronous actions

Currently we have a bad design when it comes to the connection pool management (as witnessed by the many issues posted regarding deadlocks, etc). Whether we stick with Future or go for cats.IO, we should make the connection pool use that abstraction as well.

hvesalai avatar Sep 16 '22 10:09 hvesalai

There's a lot more Future usage than that file

On Fri Sep 16, 2022, 10:30 AM GMT, Heikki Vesalainen @.***> wrote:

I don't have a vision other than a complete rewrite of https://github.com/slick/slick/blob/main/slick/src/main/scala/slick/basic/BasicBackend.scala https://github.com/slick/slick/blob/main/slick/src/main/scala/slick/basic/BasicBackend.scala Basically Slick needs asynchronous processing for three tings:

nafg avatar Sep 16 '22 12:09 nafg

Yes, but that file is the only place where Futures are being created, I think.

hvesalai avatar Sep 16 '22 13:09 hvesalai

Sure, but it would be a much bigger change than that.

Do you want to have a chat about it?

nafg avatar Sep 18 '22 22:09 nafg

@frosforever are you around?

nafg avatar Oct 20 '22 20:10 nafg

I'm not sure I have much say in this discussion. I'm no longer an active user/maintainer of slick or slick-cats.

frosforever avatar Oct 21 '22 13:10 frosforever

@frosforever who owns slick-cats?

nafg avatar Oct 23 '22 00:10 nafg