Skip to content

Commit dcc2325

Browse files
committed
feat: add upserts feature
1 parent 9f1628c commit dcc2325

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

table.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import (
1010
"net/url"
1111
)
1212

13+
type PerformUpsert struct {
14+
FieldsToMergeOn []string `json:"fieldsToMergeOn"`
15+
}
16+
1317
// Records base type of airtable records.
1418
type Records struct {
1519
Records []*Record `json:"records"`
@@ -20,6 +24,10 @@ type Records struct {
2024
// Automatic conversion is disabled by default to ensure data integrity,
2125
// but it may be helpful for integrating with 3rd party data sources.
2226
Typecast bool `json:"typecast,omitempty"`
27+
// fieldsToMergeOn will be used as an external ID to match records for updates.
28+
// For records where no match is found, a new Airtable record will be created.
29+
// https://airtable.com/developers/web/api/update-multiple-records#request-performupsert
30+
PerformUpsert *PerformUpsert `json:"performUpsert,omitempty"`
2331
}
2432

2533
// Table represents table object.

0 commit comments

Comments
 (0)