Which of the advanced Query properties are applicable to Prepared Statements, and which ones are applicable to Parameterized Queries?
binaryportalrowModerowsstreamtypesI want to wrap each Prepared Statement and Parameterized Query into two separate classes, and I want to support only the properties that are applicable within the right context.
Current documentation doesn't explain the meaning of these advanced properties to figure out which ones can be used where.
Some documentation explaining what these properties are and how to use them would be very helpful. It would also help us to plan ahead in case you are looking to deprecate any of them moving forward.
Here are the results of my own investigation into this...
According to this, it is binary result mode. I have tried to set it and look for any changes, but none found yet. How to check that it works?
No idea what it is and how it is supposed to work. However, looking at the code makes me think it doesn't work at all, because in the constructor it is set as portal, while everywhere later it is used as portalName - is this a bug?
Changes the way rows are delivered to the client. Setting to string array changes the result into array of arrays, as opposed to arrays of objects. Not sure if there is any other meaning or value for it.
According to this, number of rows to return at a time from a prepared statement's portal. 0 will return all rows at once.
Does this mean it is not used for Parameterized Queries? What about regular queries? And how to test it (I've tried setting it with a Prepared Statement, but didn't see any effect)?
Looking at the code makes me think this is something specific to using pg-copy-streams and/or pg-query-stream. Is that the case?
This code suggests it is to be used by Prepared Statements. Does this mean it is not used by Parameterized Queries?
However, this line is a bit of a concern:
this._result = new Result(config.rowMode, config.types);
because if we look at the Result implementation, it doesn't even have a second parameter. This does look like a bug.
@brianc could you, please, follow up on this?
Most helpful comment
Here are the results of my own investigation into this...
binary (boolean)
According to this, it is
binary result mode. I have tried to set it and look for any changes, but none found yet. How to check that it works?portal (string)
No idea what it is and how it is supposed to work. However, looking at the code makes me think it doesn't work at all, because in the constructor it is set as
portal, while everywhere later it is used asportalName- is this a bug?rowMode (string)
Changes the way rows are delivered to the client. Setting to string
arraychanges the result into array of arrays, as opposed to arrays of objects. Not sure if there is any other meaning or value for it.rows (number)
According to this,
number of rows to return at a time from a prepared statement's portal. 0 will return all rows at once.Does this mean it is not used for Parameterized Queries? What about regular queries? And how to test it (I've tried setting it with a Prepared Statement, but didn't see any effect)?
stream (?)
Looking at the code makes me think this is something specific to using
pg-copy-streamsand/orpg-query-stream. Is that the case?types (?)
This code suggests it is to be used by Prepared Statements. Does this mean it is not used by Parameterized Queries?
However, this line is a bit of a concern:
because if we look at the Result implementation, it doesn't even have a second parameter. This does look like a bug.
@brianc could you, please, follow up on this?