Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How is postgres binary data serialized? #660

Open
remorses opened this issue Jul 30, 2023 · 0 comments
Open

How is postgres binary data serialized? #660

remorses opened this issue Jul 30, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@remorses
Copy link

Improve documentation

Link

https://supabase.com/docs/guides/realtime/postgres-changes

Describe the problem

The realtime client is decoding data from JSON (no support for binary data), how is the binary data encoded?

What about all other values like dates, big ints, etc?

Describe the improvement

Describe how the serialization is done, even better if you switch to a binary format for encoding data, something like msgpack maybe

Additional context

From what I can see it is encoded to a string that looks like the following:

\x30343036663238326632666330663030383739656463663365313.....

It looks like it's base 10 encoded
https://hexdocs.pm/phoenix/Phoenix.Socket.Serializer.html

@remorses remorses added the documentation Improvements or additions to documentation label Jul 30, 2023
@remorses remorses changed the title How is binary data (abytes) serialized? How is postgres binary data (abytes) serialized? Jul 30, 2023
@remorses remorses changed the title How is postgres binary data (abytes) serialized? How is postgres binary data serialized? Jul 31, 2023
@w3b6x9 w3b6x9 transferred this issue from supabase/realtime-js Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant