-
Notifications
You must be signed in to change notification settings - Fork 124
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
[OTE-308] Update upsert querybuilder and compliance table upsert function #1477
Conversation
@@ -26,11 +28,16 @@ export default class UpsertQueryBuilder<M extends Model, R = M[]> extends QueryB | |||
const colBindings = cols.map(() => '??').join(', '); | |||
const valBindings = cols.map(() => '?').join(', '); | |||
const setBindings = cols.map(() => '?? = ?').join(', '); | |||
const idConditionBindings = idColumns.map(() => '?? = ?').join(' AND '); |
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.
what does ?? = ? do in this case?
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.
Positional bindings, see here
@@ -40,15 +47,14 @@ export default class UpsertQueryBuilder<M extends Model, R = M[]> extends QueryB | |||
`(${colBindings}) VALUES (${valBindings})`, | |||
'ON CONFLICT (??) DO', | |||
`UPDATE SET ${setBindings}`, | |||
'WHERE ?? = ?', | |||
`WHERE ${idConditionBindings}`, |
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.
iiuc if there are two idColumns like in the case of compliance data, this would be WHERE ?? = ? AND ?? = ?
right?
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.
Yes.
https://github.com/Mergifyio backport release/indexer/v5.x |
✅ Backports have been created
|
…tion (#1477) (#1478) * Update upsert querybuilder and compliance data upsert function * lint (cherry picked from commit a699c24) Co-authored-by: Mohammed Affan <[email protected]>
Changelist
Test Plan
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.