feat: add bulk partial update method and tests

This commit is contained in:
Mike Berezin
2021-01-29 13:21:39 +03:00
committed by mehanizm
parent 68bcb7f9f7
commit eaa12f9290
2 changed files with 33 additions and 0 deletions

View File

@@ -75,6 +75,20 @@ func (t *Table) UpdateRecords(records *Records) (*Records, error) {
return response, nil
}
// UpdateRecordsPartial partial update records
func (t *Table) UpdateRecordsPartial(records *Records) (*Records, error) {
response := new(Records)
err := t.client.patch(t.dbName, t.tableName, records, response)
if err != nil {
return nil, err
}
for _, record := range response.Records {
record.client = t.client
record.table = t
}
return response, nil
}
// DeleteRecords delete records by recordID
func (t *Table) DeleteRecords(recordIDs []string) (*Records, error) {
response := new(Records)