Batch update attributes
(batch *pgx.Batch, xid db.XID8, tenantID string, deleteClauses []squirrel.Eq)
| 504 | |
| 505 | // Batch update attributes |
| 506 | func (w *DataWriter) batchUpdateAttributes(batch *pgx.Batch, xid db.XID8, tenantID string, deleteClauses []squirrel.Eq) error { |
| 507 | for _, condition := range deleteClauses { |
| 508 | query, args, err := w.database.Builder.Update(AttributesTable). |
| 509 | Set("expired_tx_id", xid). |
| 510 | Where(squirrel.Eq{"expired_tx_id": utils.ActiveRecordTxnID, "tenant_id": tenantID}). |
| 511 | Where(condition). |
| 512 | ToSql() |
| 513 | if err != nil { |
| 514 | return err |
| 515 | } |
| 516 | batch.Queue(query, args...) |
| 517 | } |
| 518 | return nil |
| 519 | } |
| 520 | |
| 521 | // Build delete clauses for attributes |
| 522 | func buildDeleteClausesForAttributes(attributeCollection *database.AttributeCollection) []squirrel.Eq { // Build delete clauses |
no test coverage detected