Skip to content

Update doc "Supported Types and their Mappings" #393

@bill-poole

Description

@bill-poole

As @roji said here, Npgsql fully supports writing binary (typically UTF8) data to text/jsonb. I assume this means:

  • we can create a parameter with a byte[], ReadOnlyMemory<byte> or Stream value containing a UTF-8 encoded string when writing a text, json or jsonb field; and
  • we can read a text, json or jsonb field from an NpgsqlDataReader as a byte[], ReadOnlyMemory<byte> or Stream.

If so, then this is inconsistent with the documentation, which states text, json and jsonb fields can only be read as string or char[] and written as string, char[] or char.

Furthermore, if I recall correctly, Npgsql supports reading/writing bytea fields as ReadOnlyMemory<byte>; however, this is also missing from the documentation.

The documentation also does not indicate that it is possible to read a bytea field with a Stream (although it does say it is possible to write a bytea field with a Stream). My understanding is that it is possible to read a bytea field with a Stream.

Apologies if any of the above is incorrect.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions