Skip to content

expose PQsetChunkedRowsMode #79

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

exaexa
Copy link

@exaexa exaexa commented Jul 31, 2025

Hello,

essentially this is exposing the other function from the two here https://www.postgresql.org/docs/current/libpq-single-row-mode.html , which enable row streaming for looong queries.

The PR is quite straightforward so I'm not sure if much commentary is needed. I hope the C type mapping is OK. The wider context is that we'd really like to have it for continuing the work on valderman/selda#200 .

Thanks!
-mk

(cc @benjaminweb)

Copy link
Collaborator

@phadej phadej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to see test added

@exaexa exaexa requested a review from phadej August 1, 2025 07:30
@exaexa
Copy link
Author

exaexa commented Aug 1, 2025

I would like to see test added

I added in 85747d2 , hopefully all good

ntuples r3 >>= assertEqual "singlerow 3" 1
Just r4 <- getResult conn
ntuples r4 >>= assertEqual "singlerow eof" 0
getResult conn >>= assertEqual "singlerow end" Nothing
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to be a bit more verbose here (e.g. the shouldReturn use above unfortunately squishes the info about failed tests to a single line of code and single test name, this allows better debugging).

I can minify the getResult cascade code to a single zipWithM if required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants