-
Notifications
You must be signed in to change notification settings - Fork 174
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
chore(electric, docs): Update docs to mention supported data types #428
Conversation
653e481
to
5505c33
Compare
VAX-1034 Update the docs to mention supported data types
…and to explain the rationale of not supporting some types, such as Maybe drop support for BIGINT and REAL for now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 👍
Is int8 support something that can be fixed in the client? We are actually using it successfully with the Dart client to send timestamps. Are they being removed because of the 2^53 limit on JS? https://api.flutter.dev/flutter/dart-core/int-class.html We've been storing them as integers on Sqlite, so it's a bit unfortunate that they are not supported on Electric. |
@davidmartos96 Since JavaScript numbers cannot represent all values that a true 64-bit integer can hold, this opens up a door to silent data corruption. Imagine inserting a bigint > Number("4611686018427387904")
4611686018427388000 Repairing such silent corruption after the fact can be difficult or impossible. So we want to be conservative in choosing the types we allow to electrify now, until we add the necessary mapping from Postgres' The Dart client will also need to account for this. We're exploring the option of setting up a generative test suite that could be used to generate semi-random data and throw it at client-side validations. Then, whatever is validated on the client would be synced to the server to verify that the value can also be written to Postgres and that it doesn't change in the process. We should come up with a way to use the same test data with different client implementations. |
Thanks for the info! A generative test suite sounds really useful to test edge cases with different client implementations. |
Here I'm also removing
int8
from the list of types accepted by theelectrify()
function since it's not handled correctly on the client.Closes VAX-1034.