-
Notifications
You must be signed in to change notification settings - Fork 875
Milestone
Description
Hello I'm trying to use the new System.Text.Json with jsonb using Npgsql (v 4.1.2).
Here's the relevant snippet:
using var reader = await cmd.ExecuteReaderAsync(CommandBehavior.SequentialAccess);
while (await reader.ReadAsync())
{
// ...
var s = await reader.GetStreamAsync(2);
var result = await JsonSerializer.DeserializeAsync<Dictionary<string, object>>(s);
// ...
}I'm getting an exception:
System.InvalidCastException: GetStream() not supported for type jsonb
at Npgsql.NpgsqlDataReader.GetStream(Int32 ordinal, Boolean async)
at Npgsql.NpgsqlDataReader.GetStreamAsync(Int32 ordinal, CancellationToken cancellationToken)
at Npgsql.NpgsqlDataReader.GetStreamAsync(Int32 ordinal)
I understand there's reader.GetTextReaderAsync() but that seems useless with the new JsonSerializer.
Would it be difficult to support GetStreamAsync() for jsonb ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels