-
Notifications
You must be signed in to change notification settings - Fork 73
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
Simplify fetching rows with composite primary keys during backfill #595
base: main
Are you sure you want to change the base?
Conversation
LGTM. Won't approve until @andrew-farries has taken a look because auto merge is enabled. |
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.
Changes look good.
#582 is about a problem with a uuid
-valued primary key. To close it with this PR we need a test that uses such a table.
pkg/migrations/backfill.go
Outdated
@@ -134,13 +134,13 @@ func getIdentityColumns(table *schema.Table) []string { | |||
|
|||
type batcher struct { | |||
statementBuilder *batchStatementBuilder | |||
lastValues any | |||
lastValues []*string |
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.
Can the type of lastValues
be just []string
. I don't see where we need the pointer type.
Co-authored-by: Ryan Slade <[email protected]>
I changed the test table to have UUID primary key. |
This PR simplifies the way we put together the
WHERE
clause of the query we use to fetch rows during the backfilling process. We no longer check the type of the returned identifiers, instead every literal is quoted as before.I also added a test to check if we can backfilling works properly with composite primary keys.
Closes #582