arenadotio / pgx

A pure OCaml PostgreSQL client library
Other
122 stars 15 forks source link

Use BINARY mode for results #126

Open craff opened 2 years ago

craff commented 2 years ago

Hello,

I read in the documentation of postgresql that results of query can be sent to the client in BINARY, I guess it should improve efficiency and could even be simpler (the coding and decoding with string are often catchy).

So it would be nice if pgx whas using BINARY when possible instead of STRING ?

brendanlong commented 1 year ago

The complicated thing with binary mode is that it's mostly undocumented ("do whatever libpq does"), so the code will probably be simpler once it's implemented, but it's much harder to implement. There's some discussion of it on https://github.com/arenadotio/pgx/issues/38#issuecomment-439923472