postgres-nio icon indicating copy to clipboard operation
postgres-nio copied to clipboard

`PostgresQueryResult.metadata` does not account for `EmptyQueryResponse`

Open MahdiBM opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. See this for the origin.

Postgres can sometimes return an empty query response, for example when your whole query is only a comment. In that situation, there will be no command tags. The current APIs assume that the command tag is always available at that point in a query, which is not true. For now we can workaround this by settings the command tag (PostgresQueryResult.metadata.command) to an empty string.

Describe the solution you'd like PostgresQueryResult.metadata should become an optional.

Describe alternatives you've considered Just setting PostgresQueryResult.metadata.command to an empty string instead.

Additional context Add any other context or screenshots about the feature request here.

MahdiBM avatar Aug 21 '24 08:08 MahdiBM