-
Notifications
You must be signed in to change notification settings - Fork 155
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
feat(electric): Prevent updates to table PKs #725
feat(electric): Prevent updates to table PKs #725
Conversation
UpdatedRecord now has a changed_columns key...
7c17ae3
to
1aee580
Compare
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.
Nice work!
Does this need a matching client-side validation to prevent well-behaving clients from sending updates to PK columns in the first place? If it does, then we should hold off merging this PR at least until after we publish 0.8.x this week.
Also a friendly reminder to add a changeset.
components/electric/test/electric/postgres/extension/schema_cache_test.exs
Outdated
Show resolved
Hide resolved
components/electric/lib/electric/satellite/write_validation/immutable_primary_key.ex
Outdated
Show resolved
Hide resolved
assert {:ok, ["id", "owner"]} = | ||
SchemaLoader.Version.primary_keys(schema, "public", "compound_pk") | ||
|
||
{:ok, schema: schema} |
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.
FYI there's no need to return a tagged tuple from setup
callbacks. This could simply be %{schema: schema}
.
7b7059b
to
58f9077
Compare
No description provided.