PgClient released early when using Layer.effect/Layer.scoped: scope boundaries and how to keep it...
I have a Database service that I construct with Layer.effect (v4, so in v3 terms Layer.scoped). I'm not understanding how the scope works as my PgClient service is getting released while the Database is still alive.
Solution
when you provide a layer to an effect the layer will be released as soon as the effect finishes