Skip to content

Commit

Permalink
feat: add upserts feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mehanizm committed Dec 23, 2024
1 parent 9f1628c commit dcc2325
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions table.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import (
"net/url"
)

type PerformUpsert struct {
FieldsToMergeOn []string `json:"fieldsToMergeOn"`
}

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

// Table represents table object.
Expand Down

0 comments on commit dcc2325

Please sign in to comment.