You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#3152 allowed calling NpgsqlDataReader.GetStream on any data type; this allows e.g. getting a raw string representation for decoding outside of Npgsql, for efficient JSON decoding.
We could allow the same for NpgsqlDataReader.GetFieldValue<byte[]> and NpgsqlDataReader.GetBytes(), which could be useful in certain short value scenarios. We should probably wait to see if someone cares first.
The text was updated successfully, but these errors were encountered:
I could think that these methods should be called GetRawData or something, to avoid people accidentally getting a byte[] on a column instead of an exception, in case they for example used the wrong column ordinal.
We already allow this for GetStream, which seems to be the same case (i.e. no GetRawStream)
GetRawData would be Npgsql-specific (whereas GetFieldValue can be used from DbDataReader)
NpgsqlDataReader is already a type with many methods, so we shouldn't add more too lightly.
It could be claimed that if people accidentally use the raw ordinal, they'd know pretty quickly as the data they get back would not be expected. So IMHO the actual potential for bugs probably doesn't justify adding a new API.
#3152 allowed calling NpgsqlDataReader.GetStream on any data type; this allows e.g. getting a raw string representation for decoding outside of Npgsql, for efficient JSON decoding.
We could allow the same for
NpgsqlDataReader.GetFieldValue<byte[]>
andNpgsqlDataReader.GetBytes()
, which could be useful in certain short value scenarios. We should probably wait to see if someone cares first.The text was updated successfully, but these errors were encountered: