-
-
Notifications
You must be signed in to change notification settings - Fork 231
Apply foreign key constraints to UPDATE JOIN
#3037
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
Conversation
…oin node, need to implement joinUpdater
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 pretty good! A couple of small suggestions to try out and see if it helps tidy things up.
sql/plan/update_join.go
Outdated
return updaterMap, nil | ||
} | ||
|
||
// UpdatableJoinTable manages the update of multiple tables. |
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.
I think this is fine for fixing foreign keys, but as we look at making triggers work correctly, it's worth thinking about if this is the right type here... UpdatableJoinTable
implements sql.UpdateableTable
, but many of it's methods panic and can't be used (e.g. Name()
doesn't make sense when this can actually represent multiple tables with different names). That's a good sign that this isn't modeled as well as it should be. This also causes a problem in Doltgres, where the code is assuming that since it's an sql.UpdatableTable
implementation, that it can act as a sql.Table
and call other methods like Name()
.
No need to change this now, but I'd dig into cleaning this incongruence when we look at getting triggers to work across all tables.
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 good!
Modified UpdateJoin to be able to apply foreign key constraints
Part of dolthub/dolt#9356