nikita-volkov / hasql-pool

A pool of connections for Hasql
http://hackage.haskell.org/package/hasql-pool
MIT License
17 stars 15 forks source link

Motivation? #14

Closed istathar closed 2 years ago

istathar commented 2 years ago

Hey Nikita. I hesitated to ask this because I can see you've been working really hard to refine hasql-pool. I'm sure you're aware (but maybe you're not) that resource-pool was adopted and resuscitated by the community. Notably

with the result that a 0.3.0 has been released to Hackage with a number of performance and correctness fixes.

I assume you want nothing to do with it at this point, but we're using resource-pool elsewhere in our system and so noticed that suddenly hasql-pool wasn't anymore. Which is entirely fine but hey, thought I'd mention. Go ahead and close this :). All the best.

nikita-volkov commented 2 years ago

The original implementation based on resource-pool required hacks to accommodate to the requirements of resource-pool. It had something to do with exceptions but I don't remember precisely. There were several issues caused by those hacks, which you can see in the closed issues of this tracker. At some point I realised that it would be easier to just implement the pool directly. As you can see in the source code, the whole implementation now is like 80 lines of code.

avanov commented 2 years ago

@istathar FYI, as I still need to rely on resource-pool in my projects, I released hasql-resource-pool fork of v0.5.2.2 that was the last one using resource-pool internally. I intend making a switch to the recent v0.3.x release maintained by scrive (I only need to port the missing stats thing). So if you're interested in a resource-pool based implementation, feel free to contribute.

@nikita-volkov given resource-pool is redundant now, and your previous suggestion to use it for things that require dynamic settings acquisition, would you be open to consider IO-based connection settings API in the new hasql-pool implementation? The current version still doesn't allow me to use it with AWS RDS token-based authentication, and this is a predominantly mandatory setup in corporate environments I've been working with.

nikita-volkov commented 2 years ago

@avanov I've answered to your question in the according issue linked above. Thanks for bringing this up!