-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to migrate from selectSource
to selectCursor
?
#1
Comments
Hey! Firstly, thanks for taking a look at the library. Unfortunately, the problem you have is simple to describe but not simple to fix. This library needs your backend to be of the This means that we can't supply an instance for Since you can't go from a This will sadly probably mean lots of changes in the rest of your codebase, because Persistent and Esqueleto functions often have |
Thank you for the quick reply! I had a hunch we'd need a |
Alright I tried this in isolation and it seems to work fine! The only thing that I had to do was add this orphan instance (maybe we should add this as an orphan in this library, or even better in instance BackendCompatible (RawPostgresql SqlBackend) (RawPostgresql SqlBackend) where
projectBackend = id and for theQuery ::
MonadResource m =>
ConduitT () Thing (ReaderT (RawPostgresql SqlBackend) m) ()
theQuery = transPipe (withCompatibleBackend @SqlBackend)
(E.selectSource (E.from $ \thing -> return thing)
.| CL.map fromRow) |
That may be a dumb question, but I've struggled with it for an embarrassingly long time now.
We have a
Pool SqlBackend
in the environment and queries such asthat work fine using
selectSource
.When I switch from
selectSource
toselectCursor
, I get the following errorI assume there's a very straightforward way of fixing this since no one has asked. It's definitely not one of the 40 ways I tried today though.
The text was updated successfully, but these errors were encountered: