Skip to content

Conversation

@lyuboxa
Copy link

@lyuboxa lyuboxa commented Jan 9, 2025

Description

By default pgx will use encoding/json and return a map of the json. This behaviour does not play well with Avro and can result in each record to emit different schema (since JSON can be anything).

Thus any JSON data will be returned as bytes and allow the user to serder into whatever type they desire.

Fixes #229

Quick checks:

  • I have followed the Code Guidelines.
  • There is no other pull request for the same update/change.
  • I have written unit tests.
  • I have made sure that the PR is of reasonable size and can be easily reviewed.

By default pgx will use encoding/json and return a map of the json.
This behaviour does not play well with Avro and can result in each record
to emit different schema (since JSON can be anything).

Thus any JSON data will be returned as bytes and allow the user to serder into
whatever type they desire.
@lyuboxa lyuboxa merged commit 134b515 into main Jan 10, 2025
3 checks passed
@lyuboxa lyuboxa deleted the lk/handle-jsonb-json-as-bytes branch January 10, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Bug: failed to extract payload schema: cannot resolve field type \"jsonb\"

3 participants