You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a Session requires a SocketGroup, starting with Protocol.apply all the way down to BitVectorSocket.apply. However, only SocketGroup.client(to: SocketAddress[Host], options: List[SocketOption]): Resource[F, Socket[F]] is used. So instead of passing down a SocketGroup, from my understanding and field tests, a Resource[F, Socket[F]] would suffice. This would allow for a more general way to create Sessions, e.g. Session.fromSockets[F[_] : Temporal : Tracer : Console](sockets: Resource[F, Socket[F]], user: String, database: String, ...).
My motivation to supply my own Socket comes from Google Cloud Run with Google Cloud SQL, where the recommended (and most frictionless) way to connect to a Postgres database is via unix sockets. Connecting via TCP on the other hand is quite cumbersome. Google provides JDBC SocketFactories to make this integration easy, but obviously that does not work with skunk.
For now I have successfully worked my way around the skunk API with a bit of a hacky solution, so I'd prefer a cleaner way to supply my fs2 unix socket:
I played around with the skunk API already and made the necessary changes which was straightforward. If that is a desired patch to this project, I'd be happy to work on a proper PR.
The text was updated successfully, but these errors were encountered:
Creating a
Session
requires aSocketGroup
, starting withProtocol.apply
all the way down toBitVectorSocket.apply
. However, onlySocketGroup.client(to: SocketAddress[Host], options: List[SocketOption]): Resource[F, Socket[F]]
is used. So instead of passing down aSocketGroup
, from my understanding and field tests, aResource[F, Socket[F]]
would suffice. This would allow for a more general way to create Sessions, e.g.Session.fromSockets[F[_] : Temporal : Tracer : Console](sockets: Resource[F, Socket[F]], user: String, database: String, ...)
.My motivation to supply my own
Socket
comes from Google Cloud Run with Google Cloud SQL, where the recommended (and most frictionless) way to connect to a Postgres database is via unix sockets. Connecting via TCP on the other hand is quite cumbersome. Google provides JDBC SocketFactories to make this integration easy, but obviously that does not work with skunk.For now I have successfully worked my way around the skunk API with a bit of a hacky solution, so I'd prefer a cleaner way to supply my fs2 unix socket:
I played around with the skunk API already and made the necessary changes which was straightforward. If that is a desired patch to this project, I'd be happy to work on a proper PR.
The text was updated successfully, but these errors were encountered: