Replies: 1 comment 4 replies
-
That depends on what you mean by But I'm guessing that's not what you mean. I think what you are asking is for the client to only store / process one row at a time. This is the default behavior of pgx whether in its native interface or through database/sql. Do the normal |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Most ORMs I have used provide some way of choosing between a client side cursor (which fetches everything and caches it locally) or a server side cursor (which keeps an open connection as you scroll through the data). The former is the sane default the vast majority of the time, while the latter is important to use when the output of a join is larger than RAM and you want to stream it over using a buffered stream of some kind.
What is the most straightforward way to do the latter using pgx (or some other common library including database/sql )? The desired behaviour is to have the program keep a connection open where it keeps streaming the data over while doing a consistency check between a DB with an index of a filesystem and the actual filesystem it refers to.
Beta Was this translation helpful? Give feedback.
All reactions