-
Notifications
You must be signed in to change notification settings - Fork 71
[WIP] Add Cursor module #212
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
Conversation
-- FIXME: ...withParser + create "plain" one with FromRow r instead | ||
fetchForward :: RowParser r -> Cursor -> Int -> (a -> r -> IO a) -> a -> IO a | ||
fetchForward parser (Cursor name conn) chunkSize f a0 = do -- FIXME: escape name! | ||
let q = toByteString (byteString "FETCH FORWARD " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a very minor difference here wrt. the original implementation in foldWithParserBlahblah: We construct this string every time around the loop, but seeing as we're fetching from a database (thus already incurring the cost of I/O), I don't think it's a big other. Alternatively one could specify the chunkSize up front when creating the cursor, but then one loses the possibility of using an adaptive algorithm.
a828be5
to
32d76c4
Compare
EDIT: Scratch that. ~~Ok, so I've cleaned most of it up. All that's missing is fixing an infinite loop in Btw, I think everything up to the ff43f70 commit should be good to go, so feel free to merge that. I'd basically consider 8724be7 it a clean up that's worth it regardless of whatever else happens to this PR.~~ |
32d76c4
to
f815f5a
Compare
Ok, should be good to go, modulo comments... though the PR looks kind of messed up right now. Not sure what happened. I'll open a new one since you haven't commented on anything yet. |
LOL! Honestly I'm not entirely sure. It just sorta, happened. I think the current implementation of the Also, there's a less obvious circular dependency in the |
Hi,
So this is the gist of what I want to do. It doesn't actually compile right now due to circular dependencies. (My word, how did this code get so tangled up in circular dependencies?)
Obviously it's missing documentation and I need to actually get it compiling + prettify it a little bit. Wrt. getting it compiling... is it OK if I do a little moving around of code in commits leading up to this? (If you want I can try to be extra careful to preserve the interface and just move a few implementations around and re-export to preserve the old interface. Or we could just bump versions according to PVP.)
What do you think?
EDIT: Obviously the only thing that makes sense is to view the full diff. Individual commits don't make any sense ATM.