Stream LOB
Hi,
Thanks for go-ora !
I need to handle LOB by chunk of data. It seems go-ora does not expose io.Reader API for Lob. What do you think of this feature ? Would you accept a patch in this direction ? Do you have clues on this issue ?
Regards, Étienne
A proposal would bo to hijack lob.data using a new API lob.Hijack(f io.Writer). What do you think of this ?
A proposal would bo to hijack lob.data using a new API
lob.Hijack(f io.Writer). What do you think of this ?
I dug a but. This is not the right path. Need to investigate this more. Clues welcome.
Hi @bersace I will investigate how to implements and inform you
For now, I investigate streaming LOB using DBMS_LOB.SUBSTR. This streams by chunk of 4k (BLOB) or 2k (CLOB). Such small chunk has overhead.
Actually, pgx wraps Postgres LO API in a io.ReadWriter struct. This is easy because Postgres LO has an OID. So the app queries de OID and execute de streaming API for each OID.
It seems that we can't apply such easy logic with ORA.
Using DBMS_LOB.SUBSTR is extremly slow. I dream of a way to stream chunk of data using io.Writer, maybe using a specific API. Something like:
var lob ora.LOB
row.Scan(&lob)
lob.Read(buffer) // stream a chunk of data.
@sijms at oracle protocol level, how does Oracle send data ? What are the network messages ? How many ? Which size ? Which order ?